An Iterative Solution for Pi Using Pythagorean’s Theorem

Pythagoras, “Father of the Shortcut”, is honored every time someone diagonally traverses their campus lawn rather than taking perpendicular sidewalks to class.

Using Pythagorean’s Theorem and High School-level algebra, I will show you a simple derivation I found for an iterative expression of pi. (Yes, it was once again during a long, boring summer internship with nothing to do.)

Before we begin, we must define pi so that we will know how to find it. Pi (π) is a constant which relates the diameter of a circle to its circumference. In other words, if we know both the diameter and circumference of a circle, dividing the latter by the former will yield pi.

Our approach to finding this constant will be as follows:

  1. Inscribe a circle with a regular polygon (equal side lengths). Find the circumference (perimeter) of the “circle”, then divide this value by the diameter.
  2. Double the number of sides of the previous polygon. Find an expression that relates the side length of the new polygon to the side length of the previous polygon, then repeat step 1 with the new polygon.
  3. Repeat step two indefinitely
  4. Identify a recurring pattern. Iterate to solve for pi.

Basically, we are taking a polygon and systematically “cutting” off its corners. As we remove more corners (by increasing the number of sides of the inscribing polygon), the polygon will begin to resemble a circle and our approximation for pi will become more accurate. As the number of sides approaches infinity, our approximation for pi will approach the actual value of pi.

Before we begin, here are a few points of clarification concerning the following illustrations and poorly chosen variable indicators:

  • “D” variables (D1, D2, etc.) do not represent the diameter of the circle. They are diagonal lengths from opposite corners of inscribing polygons. We will need to calculate these values for each iteration.
  • “S” is the length of the shortest line which bisects the approximating polygon. This DOES represent the diameter of the circle. Since all polygons will inscribe the same circle, this value will always be constant.
  • “S” variables (S1, S2, etc.) are the side lengths of polygons. The accompanying number relates to the iteration number. These are not to be confused with “S”, a constant value for the diameter of the circle.

First Iteration

The first polygon we will use to approximate the circle will simply be a square. For those of you who don’t remember what a square looks like, you can stop reading this now.

Finding S1 and the Circumference

From the image, we can easily see that S1 is just S.The “circumference” of a regular polygon is the number of sides of that polygon times the side length. Thus, in this case,

Circumference = 4*S1 = 4*S.

Approximating Pi

Since the diameter of the “circle” is S, our approximation for pi is simple:

π = Circumference/Diameter = 4*S/S = 4.

Of course, 4 is a very bad approximation for pi. But we’ll let it slide since this is just the first iteration.

Finding D1, the Diagonal Length

The next step is to calculate D1, the diagonal length of the polygon. We will need this value for the next iteration.

Since S1=S,


Second Iteration

Here’s an image showing the second iteration after doubling the number of polygon sides. The first polygon is also shown for reference.

Finding S2 and the Circumference

What is the value for S2? This is where things begin to get a little complicated.

S1, calculated in the previous iteration (we recognized that its value was simply S), is the sum of S2 and the two green lines shown in the image above (I apologize if you’re color-blind). The lengths of these green lines are found using Pythagorean’s Theorem:

Green line = √((S2/2)²+((D1-S)/2)²)

Adding the value for Green Line to the expression for S1 and taking things a step further, we see that

(S1-S2)² = (S2)² + (D1-S)²

Expanding, swapping S1 for S, and isolating S2, we get


Our approximation for pi is:

π = C/D = 8*(√2-1)*S/S = 8*(√2-1).

This value is, to 4 decimal places, 3.3137. This is a much better approximation, but still not  nearly good enough.

Finding D2, the Diagonal Length

From the Pythagorean Theorem,


Third Iteration

Here is an image of the 16-sided polygon (twice as many sides as the previous polygon) for this iteration.

From the image, we can tell that the derivation for all equations necessary to perform the iteration will be identical to the previous iteration, apart from the doubled number of sides needed to find the circumference. We use Pythagorean’s Theorem to find S3, approximate pi, then use Pythagorean’s Theorem to calculate D3 in order to proceed to the fourth iteration.

Finding an Iterative Expression for Side Length (Sn)

The equation for find S3 is identical to that of finding S2, and will be the same for all future iterations. Using exactly the same equation shown in the second iteration with updated variables for the third iteration, we find that:


Isolating for S3:

S= -(D2²-2*S*D2+S²-S2²)/(2*S2)

In our last iteration, we calculated that the value for D2 is

D2 = √(S² + S2²)

Plugging in this expression for D2 into the previous equation, we find that

S3= -(S² – S*(S^2 + S2²))/S2

Recall that the value for S is arbitrary. To simplify calculations, I am going to say that S=1. Then,

S2= (√(1 + S2²) – 1)/S2

Here’s this expression in an iterable form:

S= [√(1 + Sn-1²) – 1]/Sn-1

To work, this expression requires that S1 = 1 (since we just chose S = 1 to simplify the expression, and we already established that S= S).

How to Calculate Pi

Recall that by definition, pi is the circumference of a circle divided by the diameter. For the our iterations, we have been using an expression like this to find pi:

π = C/D = Nn*Sn/S

where Nn is the number of sides of the polygon for that iteration.

For each iteration, the number of sides doubled. We started at 4 sides for the first iteration, 8 for the second, and so on. Thus,

Nn= 2n+1

where n corresponds to the iteration number.

Our final expression for pi is

π = C/D = 2n+1*[√(1 + Sn-1²) – 1]/Sn-1 

where S= 1.

Here is an example of how to use this expression:

Note that Sn is first solved, then multiplied by Nn to find pi.


This iterative method will always result in a value for pi that is at least infinitesimally larger than the actual value. This is because the circle will always be inscribed within the polygon and will thus always have a smaller circumference.

Suppose we decided to switch tactics and, rather than dividing the circumference of the approximated “circle” by the selected diameter (S), we used a value corresponding to a circle that, rather than being inscribed by, intersected the midpoints of the polygon edges. This should theoretically give us a value closer to the actual value for pi.

To accomplish this, we modify the diameter to be half of the original diameter (inscribed) and half of the polygon diagonal (characteristic of a circumscribing circle):

Diameter = S/2 + Dn/2

where “Dn” represents the diagonal corresponding to the nth iteration.

For n=2, we get

π = C/D = 8*(√2-1)*S/(S/2+S√(4-2√2)/2) = 16*(√2-1)/(1+√(4-2√2)).

This gives, to four decimals, 3.1826, which is significantly closer to pi than the original approximation of 3.3137.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s