There are 12 digaonals that have a length of P_1 P_2, which from the Sine Law, is sin (15 degrees). There are 12 diagonals that have a legnth of P_1 P_3, which from the Sine Law, is sin (30 degrees). We can appy the same reasoning to the other diagonals, which gives us a total sum of
(12 sin 15)^2 + (12 sin 30)^2 + (12 sin 45)^2 + (12 sin 60)^2 + (12 sin 75)^2 + (12 sin 90)^2 + (12 sin 105)^2 + (12 sin 120)^2 + (12 sin 135)^2 + (12 sin 150)^2 + (12 sin 175)^2 = 864.