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:
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.
\text{floor}(n/2)
such verticals so you can stop the algorithm after that many.