Pi from Polygons

Computing Pi using perimeters of regular polygons and a circle with unit radius

Source ↗

Cover image for Pi from Polygons

Why

π turns up in places it has no business being, and that has always bugged me (in the good way). A Veritasium video on how mathematicians computed it by hand, long before calculus, pushed me to try the oldest method myself: does it actually work, and how fast?

What it does

This is Archimedes’ method. Put a regular polygon inside a unit circle and another one outside it. The circle’s circumference is trapped between the two perimeters, so π is squeezed between two bounds:

nsin⁡πn  <  π  <  ntan⁡πnn\sin\frac{\pi}{n} \;<\; \pi \;<\; n\tan\frac{\pi}{n}

The sketch starts with triangles and adds a side every second. The blue (inner) and red (outer) curves at the bottom close in on π from both sides.

What I found

It works, but slowly. At 30 sides π is pinned only to between 3.136 and 3.153. The gap shrinks roughly as 1/n², so each extra digit costs about three times more sides. Archimedes went to 96 sides and got 3.1408 < π < 3.1429, which is where 22/7 comes from.

The catch

Looking back at the code, I cheated without meaning to. sin(180/n) in degree mode converts degrees to radians by multiplying by π, so the sketch uses π to compute π. Archimedes had no such shortcut. He started from a hexagon and doubled the sides each step using only square roots, so π never appears anywhere. That would be the honest version of this sketch, and a good excuse to revisit it.