How to plot n coords to distribute evenly as a ring of points around a circle?

2.6k Views Asked by At

Given a circle coord at (100, 100) with radius 25. I want to plot a group of points around the circle to form a ring around it. What is the formula I will need to determine the coordinates of each of these Points?

E.g. I have 10 points to plot in this ring, how to calculate the coordinates to plot them from the circle coords? For each point, I have something like this at the moment: x: coords.x + (size / 2 * (i + 1)), which results in this:

enter image description here

But my desired result should be like this:

enter image description here

Context: To build a table and some chairs in a computer program. The central circle represents the table and the n points represent the chairs.

2

There are 2 best solutions below

0
On BEST ANSWER

You can parameterize the circle of radius $r$ centered at $z_0$ as $$z(t)=z_0 +re^{it}$$ where $0\leq t<2\pi$. Taking $t_k=2\pi k/n$ for $k=0,1,\ldots,n-1$ produces $n$ equally spaced points along the circle.

In terms of real numbers, the center is $(x_0,y_0)$ and the points are given by $$(x_0+r \cos t_k, y_0+r\sin t_k) $$

0
On

$(x_k, y_k) =(x_0+r\cos(2k\pi/n), y_0+r\sin(2k\pi/n)) $ for $k = 0 $ to $n-1$.