# how to put elements around circle with equal distance?

I know circle formula and know how to draw it. but I want put 4 points on it with equal distance from each other. how can I do that?

I work with unity.

• This solves it: answers.unity.com/questions/714835/… Jul 17 '18 at 17:41
• @LinkWindcrafter thanks. I had to guess. I have to use traigonometry Jul 17 '18 at 17:44

It sounds like you want to make a regular polygon. It also sounds like you're talking about 2D space, but just for fun, here's a way to do that for any number of points and any arbitrary circle in 3D space:

public Vector3[] circlePoints (int n, float radius, Vector3 center, Vector3 normal) {
var points = new Vector3[n];

Vector3 offset = Vector3.ProjectOnPlane(Vector3.right, normal).normalized * radius;
float angle = 0;

for (int i = 0; i < n; i++) {
Vector3 rotatedOffset = Quaternion.AngleAxis(angle, normal) * offset;
points[i] = center + rotatedOffset;

angle += 360f / n;
}

return points;
}


Set normal so that it's perpendicular to the circle you want to draw on. So if your game is 2D, use Vector3.forward, since that's perpendicular to the XY plane.

However, for a 2D game or one where every circle is on the same (axis-aligned) plane, I would just go with a trigonometric solution.