# Formulae for length of diagonals of a regular $n$-gon

Is there a closed-form expression to compute the length of an arbitrary diagonal of a regular unit $n$-gon?

• – lhf Feb 2 '18 at 0:34
• Did you look at the linked question? A closed form solution is given, though it takes a bit of typo correction. – Ross Millikan Feb 13 '18 at 15:17

For the $k$th diagonal of a polygon that's inscribed in a unit circle, the length is $$\sqrt{ (\cos(\frac{2\pi k }{n}) - 1)^2 + \sin(\frac{2\pi k }{n})^2 }.$$
You can sanity-check this by seeing that for $k = 0$, it gives the answer $0$, and for even $n$ and $k = n/2$, you get $2$, which is correct because that diagonal is a diameter of the circumcircle of the $n$-gon.
You can also slightly simplify; \begin{align} L_k &=\sqrt{ (\cos(\frac{2\pi k }{n}) - 1)^2 + \sin(\frac{2\pi k }{n})^2 }\\ &=\sqrt{ \cos^2(\frac{2\pi k }{n}) - 2 \cos(\frac{2\pi k }{n}) + 1 + \sin(\frac{2\pi k }{n})^2}\\ &=\sqrt{ \cos^2(\frac{2\pi k }{n}) + \sin^2(\frac{2\pi k }{n}) - 2 \cos(\frac{2\pi k }{n}) + 1} \\ &=\sqrt{ 1 - 2 \cos(\frac{2\pi k }{n}) + 1} \\ &=\sqrt{ 2 - 2 \cos(\frac{2\pi k }{n})} \end{align} The reason? 1. A point at angle u around the circle from (1, 0) (measuring counterclockwise) has coordinates (\cos u, \sin u), by basic trig. 2. The points of an n-gon are at angles 0, \frac{2\pi}{n}, 2\frac{2\pi}{n}, \ldots, (n-1) \frac{2\pi}{n}, because the n vertices divide the 2\pi total angle of the circle into n equal pieces, each of size \frac{2\pi}{n}. 3. The 0th point -- the start --- is at (\cos 0, \sin 0) = (1, 0). 4. The kth point is at (\cos( k\frac{2\pi}{n}), \sin( k\frac{2\pi}{n})), using items 1 and 2. 5. The distance between points (a, b) and (x, y) is \sqrt{(a-x)^2 + (b-y)^2}; that's the standard distance formula in the plane. 6. Applying this to (a, b) = (\cos( k\frac{2\pi}{n}), \sin( k\frac{2\pi}{n})) and (x, y) = (1, 0) gives the formula I wrote down. • why is this? Can you give me a step by step proof? – William Grannis Feb 13 '18 at 15:34 • See revised answer, which includes an explanation. – John Hughes Feb 13 '18 at 16:31 The length of the k-th diagonal isd_k = 2\sin(k \pi/n) \quad \text{ for } k \le n/2.$$You can check via trig identities that this does agree with the answer of G Cab and John Hughes. First explanation for the formula: you want the length of a chord subtending a central angle of 2\pi k/n. You can place the chord anywhere you want on the circle. So you might as well place it with endpoints at (\cos k \pi/n, \sin k \pi/n) and (\cos k \pi/n, -\sin k \pi/n), so the chord is vertical. Then the length of the chord is the difference in y-coordinates. Second explanation for the formula: Read the post of G Cab up the the point where one obtains$$ d_k = |e^{i k 2 \pi /n} - 1|, $$where it suffices to consider k \le n/2 by symmetry of the n-gon. Now we are going to let the complex numbers take care of the trigonometry and distance formulas. I'll write the computation, and then give some details:$$d_k = |e^{i k 2 \pi /n} - 1| = |e^{i k \pi /n} - e^{-i k \pi /n}| = 2 \sin(k \pi/n)$$for k \le n/2. In the first step, we use that for t real, |e^{-it}| = 1. So$$|e^{i2t} -1| = |e^{-it}| |e^{i2t} -1| = |e^{-it}(e^{i2t} -1)| = |e^{it} - e^{-it}|. $$Now$$ e^{it} - e^{-it} = (\cos t + i \sin t) - (\cos t - i \sin t) = 2i \sin t. $$So$$ |e^{it} - e^{-it} | = |2i \sin t| = |2 \sin t| = 2 \sin t, $$if 0 \le t \le \pi/2. • lean (+1): can be easily derived from other formula by applying angle-duplication – G Cab Feb 14 '18 at 16:57 The vertices of a regular n_agon, inscribed in a circle of radius 1, represented in the complex plane will be$$ e^{\,i\,{{2k\pi } \over n}} \quad \left| {\;0 \le k \le n - 1} \right. $$If we take the difference with the point at (1+i0), i.e. the one with k=0, we get all possible diagonals$$ d_{\,k} = e^{\,i\,{{2k\pi } \over n}} - 1\quad \left| {\;1 \le k \le n - 1} \right. $$Concerning their length, then$$ \eqalign{ & \left| {d_{\,k} } \right| = \left| {e^{\,i\,{{2k\pi } \over n}} - 1} \right| = \sqrt {\left( {1 - \cos \left( {{{2k\pi } \over n}} \right)} \right)^2 + \sin ^2 \left( {{{2k\pi } \over n}} \right)} = \cr & = \sqrt {2\left( {1 - \cos \left( {{{2k\pi } \over n}} \right)} \right)} \cr}  which is of course symmetric around $k=n/2$.