There’s nothing at all new about this, in fact it’s ancient, but maybe it’s new to you? So here goes.

Here’s a square inscribed in a unit circle:

Or to keep down the clutter, here’s just one quadrant of that:

One side of the square along with the radii at each endpoint forms a triangle. The length of one side of the square we’ll call and it is of course . That means the perimeter of the square is .

Now consider an inscribed octagon. Again, here’s just one quadrant.

One side of the square is labeled ; what’s its length? Well, drop a perpendicular from the vertex in the middle:

And now notice the right triangle with hypotenuse 1 and sides and is just half of a quadrant of an inscribed square, which means . Then . From that you can get and from that, . The perimeter of the octagon is then .

Well, that was so much fun, let’s do it again. Here’s a quadrant of a 16-gon:

The right triangle with hypotenuse 1 and sides and is just half of an eighth of an inscribed octagon, which means . Then , , and . The perimeter of the 16-gon is then .

You know the rest, right? From here you can do the 32-gon, 64-gon, 128-gon, and so on, getting , , , and perimeter . For , the perimeter is . As increases, the perimeter gets closer and closer to the circumference of the circle, so this gives a way to calculate .

What about circumscribed polygons? If you look at the figures above, you can see the ratio of the size of a circumscribed square to an inscribed square is . Likewise the ratio of the size of a circumscribed octagon to an inscribed octagon is , and so on. So the perimeter of a circumscribed -gon is . As increases, approaches from above. And the average of and is a better approximation to than either, though not by a lot.

n | h_n | x_n | y_n | s_n | p_n | P_n | average |

4 | 1.41421356 | 5.65685425 | 8.00000000 | 6.82842712 | |||

8 | 0.70710678 | 0.70710678 | 0.29289322 | 0.76536686 | 6.12293492 | 6.62741700 | 6.37517596 |

16 | 0.38268343 | 0.92387953 | 0.07612047 | 0.39018064 | 6.24289030 | 6.36519576 | 6.30404303 |

32 | 0.19509032 | 0.98078528 | 0.01921472 | 0.19603428 | 6.27309698 | 6.30344981 | 6.28827340 |

64 | 0.09801714 | 0.99518473 | 0.00481527 | 0.09813535 | 6.28066231 | 6.28823677 | 6.28444954 |

128 | 0.04906767 | 0.99879546 | 0.00120454 | 0.04908246 | 6.28255450 | 6.28444726 | 6.28350088 |

256 | 0.02454123 | 0.99969882 | 0.00030118 | 0.02454308 | 6.28302760 | 6.28350074 | 6.28326417 |

512 | 0.01227154 | 0.99992470 | 0.00007530 | 0.01227177 | 6.28314588 | 6.28326416 | 6.28320502 |

1024 | 0.00613588 | 0.99998118 | 0.00001882 | 0.00613591 | 6.28317545 | 6.28320502 | 6.28319024 |

This is something like the way Archimedes calculated around 250 BC (I *told* you this was ancient), although he started with a hexagon rather than a square and only went up to a 96-gon. He didn’t have Google Sheets, though.