The first question that got me here: A regular dodecagon $P_1 P_2 P_3 \dotsb P_{12}$ is inscribed in a circle with radius $1.$ Compute$ {P_1 P_2}^2 + {P_1 P_3}^2 + {P_1 P_4}^2 + \dots + {P_{10} P_{11}}^2 + {P_{10} P_{12}}^2 + {P_{11}P_{12}}^2.$ (The sum includes all terms of the form ${P_i P_j}^2$ where $1 \le i < j \le 12.$ We write $P_iP_j$ to mean the length of segment $\overline{P_iP_j}$.)
I solved the question and got 144. Since this is I wondered if the total would be true for any n-gon?. More specifically, for any n-gon would this total be equal to $n^2$.
This is Dodecagon:

For a regular $n$-gon of radius $1$, the sum of squares of diagonals from one vertex is
$S_\text{one}=\sum\limits_{k=1}^{n-1}\left(2\sin \left(\frac{k\pi}{n}\right)\right)^2$
If $n$ is even, $n=2m$:
$\begin{align} S_\text{one}&=4\sum\limits_{k=1}^{2m-1}\sin^2\left(\frac{k\pi}{2m}\right)\\ &=4\left(\sum\limits_{k=1}^{m-1}\sin^2\left(\frac{k\pi}{2m}\right)+1+\sum\limits_{k=m+1}^{2m-1}\sin^2\left(\frac{k\pi}{2m}\right)\right)\\ &=4\left(\sum\limits_{k=1}^{m-1}\sin^2\left(\frac{k\pi}{2m}\right)+1+\sum\limits_{k=m+1}^{2m-1}\cos^2\left(\frac{\pi}{2}-\frac{k\pi}{2m}\right)\right)\\ &=4\left(\sum\limits_{k=1}^{m-1}\sin^2\left(\frac{k\pi}{2m}\right)+1+\sum\limits_{k=m+1}^{2m-1}\cos^2\left(\frac{(m-k)\pi}{2m}\right)\right)\\ &=4\left(\sum\limits_{k=1}^{m-1}\sin^2\left(\frac{k\pi}{2m}\right)+1+\sum\limits_{k=1}^{m-1}\cos^2\left(\frac{k\pi}{2m}\right)\right)\\ &=4\left(\sum\limits_{k=1}^{m-1}1+1\right)\\ &=4m\\ &=2n \end{align}$
A similar argument shows that if $n$ is odd then $S_\text{one}=2n$.
To find the the sum of squares of all diagonals, we first multiply $S_\text{one}$ by the number of vertices, $n$. But then we have counted each diagonal twice, so we divide by $2$.
So the sum of squares of all diagonals is $n^2$.