# Calculate coordinates of a regular polygon

Given the regular polygon's side count $n$, the circumscribed radius $r$ and the center coordinates $(x,y)$ of the circumscribed circle,

How to calculate the coordinates of all polygon's vertices if one of the vertices coordinates are $(x,?)$?

• Do you know complex numbers? – davidlowryduda Mar 6 '12 at 18:16
• @mixedmath i? – Cobold Mar 6 '12 at 18:19

One vertex is $(x, y+r)$ or $(x, y-r)$. I'll assume the former (the latter case is similar, just swap $r$ and $-r$). The vertices will have coordinates $(x+r\sin\theta,y+r\cos\theta)$, where $\theta$ is an integer multiple of $\frac{2\pi}{n}$. ($\frac{360}{n}$ if you prefer degrees to radians.)
• Shouldn't it be $(x + r cos \theta , y + r sin \theta )$ (switch $sin$ and $cos$)? – jasonszhao Jun 2 '16 at 18:39
• @jasonszhao both will work, it's just a question of the order the vertices are created. As written in the answer, the first vertex drawn (when $\theta = 0$) will be the north-most one. The way you have it, the first vertex would be the west-most one. – bgschiller Aug 10 '17 at 0:18
Supposing you know complex numbers, we care only about polygons around the origin which are inscribed in the unit circle. If a vertex is at $e^{i\omega}$, then the other n vertices will be at $e^{i(\omega + 2\pi k/n)}$ for $k$ up to $n$.