Notes
Code
Here's a Python implementation of the algorithm we developed:

Consider a regular \(n\)-gon inscribed in a circle of radius 1:
Show that its perimeter is given by \(2n \sin\left(\frac{360^\circ}{2n}\right).\)
Subdivide the \(n\)-gon into \(n\) triangles, as shown in the figure. Each such triangle shares a side with the \(n\)-gon; we write \(b \) for the length of this side and \(\theta\) for the angle opposite to it. The perimeter of the \(n\)-gon is thus \(nb;\) note also that \( \theta = \frac{360^\circ}{n}. \) In problem 4 from the trigonometry review , you showed that \(b = 2\sin(\theta/2) .\) Combining these, we get that the perimeter is \(2n\sin\left(\frac{360^\circ}{2n}\right). \)
\(\theta\)
\(b\)
Recall that \(\Twopi\) is defined to be the circumference of a unit circle, and \(\pi\) is defined to be half this quantity. Compute approximate values of \(\Twopi\) and \(\pi\) (to 4 decimal points, say).