Approximate position on circle for n points
问题 I am struggling with the following problem: I am given n points and a radius and I have to place them on a circle as symmetrical as possible. Currently, I used something like this: float theta = 360.0f / n; int i = 0; for (Word w : e.getValue()) { double newX = Math.sin(theta * i) * RADIUS + I_OFFSET_X; double newY = Math.cos(theta * i) * RADIUS + I_OFFSET_Y; mxCell v2 = (mxCell) graph.insertVertex(parent, null, w.getValue(), newX, newY, OW_WIDTH, OW_HEIGHT,"shape=ellipse"); graph.insertEdge