N-gon Pi Approximator

1.1760.809

Overview


The above visualization shows intuitively how we can approximate a circle and thus the radius and circumference of a circle by inscribing a regular polygon with more and more sides inside that circle.


Since the equations for the area and circumference of a circle are directly related to pi and the radius of the circle, by approximating these values, we are also able to make an approximation for pi.


Approximating Pi with a pentagon


The equations for the area and radius of a circle are:


Lets look at the example where we try to approximate pi by using the area of a regular pentagon inscribed in a circle with radius 1. We can solve for the area of the circle like so:


The pentagon on the other hand is a bit trickier to solve for. We can think of the pentagon as being composed of 5 triangles. Each one has a side that touches two points on the circle as well as 2 sides that are also radii of the circle. Since the combined 5 triangles fully surround the center we know that the 5 interior angles at the center can be solved for using:Dividing this isosceles triangle into 2 right triangle allows us to use the power of trigonometry to solve for the height and base of the triangle. Dividing the angle by 2 gives us an angle in the smaller triangles.


The apothem of a polygon is the term for the distance from the center of a polygon to one of its sides. Since our theta is the angle of our smaller triangle closest to the center of the circle we can use sin and the fact that the hypotenuse is also the radius of the circle, 1, to solve for the apothem. We can solve for the apothem of our pentagon and height of our triangle by using:


We can solve for the base of the larger triangle which there are five of by doubling the base of the smaller triangle. Since we know one of the angles and the hypotenuse of the small triangle we can use cosine to solve for the base using this formula:


We now have everything that we need to solve for the area of the larger triangle. The area of a triangle is:Since we have solved for the side length and the apothem we can now substitute in to our equation to get the area of one of our larger triangles.


Since there are 5 larger triangles that compose the inscribed pentagon we can solve for its area by multiplying our triangle area by 5 which gets us:


Taking it to the limit


All that work just to get 2.38 as an approximation of pi!? Was this all just a waste of time? Well, if we take a closer look at our equation, it might already pop out at you that making a generic version of this equation for a polygon with more sides is a rather easy adjustment. We just need to replace the fives in our equation with our variable for the number of sides in our polygon, n.If we plug n = 30 into the equation we get.


This is a much better approximation of pi! And it makes sense too, our 30 sided polygon has much more points that are in contact with the circle an thus matches the shape of the circle much closer. In fact the more sides you add the closer and closer the area value is to pi! Try plugging in 100 for n and you will see that the area of the 100 sided polygon is an even better approximation for pi. The answer is left as an exercise for the reader.


What if we didn't limit ourselves to having just 100 sides but took it to infinity. What would it look like to have an inscribed polygon with infinite sides. Thanks to calculus we can write this using a limit.


As n approaches infinity the first term, n, gets infinitely large, the second term, cos(0), approaches 1, and the third term gets infinitely small approaching sin(0) = 0. Since the first term and the last term are infinitely growing or shrinking the expression and thus can not be taken out but cos(0) is approaching 1 a non-controversial number and thus can be removed from the limit.


The problem is definitely easier to solve now that we have gotten rid of the cosine. However, it is definitely still annoying until we get rid of the n or the sin(). This is where substitution comes in. If we say:


Here we have a new problem. As t approaches 0 the fraction approaches 0 over 0 which is undefined. In this case we can use L'Hospital's rule which states that when we have a limit that approaches 0 over 0 we can make a new limit using the derivative of the numerator over the derivative of the denominator.The area of an n-sided regular polygon inscribed in a circle with radius one approaches pi as n approaches infinity! This proves that as a polygon with n sides inscribed in a unit circle gets infinitely many sides the area approaches PI exactly. This intuitively makes sense because as you increase the amount of sides on the polygon the more points touch the circumference of it. If the polygon has infinitely many sides that would mean that infinitely many points on the polygon are touching the circle which makes it more or less the same as the circle that it is inscribed in.

© 2025 Buxo Webdev