Write a function to compute the total length of between all vertices of a regular polygon inscribed in a unit circle. For example, a square in a unit circle would have side length of sqrt(2) and each of the two diagonals would have a length of 2. Therefore, for n = 4 the total length is 4(1+sqrt(2)). In the hexagon below, there are 6 lines of length 1 connecting adjacent points, 3 lines of length 2 connecting opposite points, and 6 lines of length sqrt(3) connecting points two away; therefore, for n = 6, the total length is 6(2+sqrt(3)).
hexagon

Solution Stats

11 Solutions

8 Solvers

Last Solution submitted on Jan 04, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...