pull down to refresh

Hmm, I don't have time to check if my solution is accurate, but if you measure the angles at each corner (measured from the vertical line downwards), the first angle is always:
\theta_1 = \left(\frac{n-2}{2n}\right) 180
And subsequent angles follow the pattern:
\theta_{i} = \theta_{i-1} - \left(\frac{2}{n}\right) 180
So I guess the i-th vertical line always has the length:
v_{i} = \ell \cos \theta_{i}
where $\ell$ is the length of the polygon's sides.
Moreover, there are \text{floor}(n/2) such verticals so you can stop the algorithm after that many.
Will check this more carefully tomorrow, I'm on the go now. I wonder if applying your formula works out to find the pattern mentioned in my most recent comment.
reply