Pi Calculations

Pi (π) is defined as the Circumpherence (C) of a circle divided by its diameter (d).

Table of Contents

1. Using Trigonometry
2. Using Differential Calculus
3. Using Integral Calculus
4. Using Polygons
5. Precision

1. Using Trigonometry

Key:

CCircumference
CiCircumference, inner polygon
ddiameter
rradius
xipoint x-inner value
yipoint y-inner value
θtheta, angle at the center
ψpsi, angle at the periphery near the circle

Method

Take a generic polygon, in this case a hexagon (6 sides), and divide it as shown.

Notice that you can divide the triangle to the upper right and create a length of yi.

In this case, you can use yi as a rough estimate of the radius (r).

By taking ever smaller values of angle (π), and ever smaller values of yi, then multiply inversely proportional to the angle to get a rough estimate of the circumpherence (C), you can then divide this by the diameter (d) to get pi (π).

Formulae

sin θ = y ir

Since r = 1:

sin θ = y i

π = Cd = C2r

Calculations

θ = 60° = 1.047 radians

sin(1.047) = yi = 0.866

6 yi = 6 x 0.866 = 5.196 < C

π = C2r = 5.1962 = 2.598076211

Note: this is only a first approximation. If you double the divisions from 6 to 12 to 24, and so on, you can build a table of calculations that follows. As you approach 18 iterations, or 786,432 divisions, you approximate π by six decimal points. You can carry out his calculation to get as much precision as necessary. π is an irrational number, so that the series repeats to infinity.

Table

#DivDegRadsyimultπ (÷2)
16601.0470.8665.1962.598076211
212300.5240.5006.0003.000000000
324150.2620.2596.2123.105828541
4487.50.1310.1316.2653.132628613
5963.750.0650.0656.2793.139350203
61921.8750.0330.0336.2823.141031951
73840.93750.0160.0166.2833.141452472
87680.468750.0080.0086.2833.141557608
91,5360.2343750.0040.0046.2833.141583892
103,072117.19 x10-30.0020.0026.2833.141590463
116,14458.59 x10-30.0010.0016.2833.141592106
1212,28829.30 x10-30.0010.0016.2833.141592517
1324,57614.65 x10-30.0000.0006.2833.141592619
1449,1527.32 x10-30.0000.0006.2833.141592645
1598,3043.66 x10-30.0000.0006.2833.141592651
16196,6081.83 x10-30.0000.0006.2833.141592653
17393,216915.53 x10-60.0000.0006.2833.141592653
18786,432457.76 x10-60.0000.0006.2833.141592654
∞    3.141592654

Graph

Graph


2. Using Differential Calculus

Key:

CCircumference
ddiameter
rradius
xopoint x at the initial iteration, on the circle
yopoint y at the initial iteration, on the circle
xnpoint x after n iterations
ynpoint y after n iterations
θoangle theta, at the initial iteration
θnangle theta, after n interstions

Method

Take ever smaller values for theta (θ), using the differential equation listed below.

Formulae

sin θ = yor

r = 1

Therefore, we simply to:

sin θ = yo

Fron Trigonometry, we know that:

θ→0 lim sin θθ → 1

Substitute π/n for θ:

π/n→0 lim sin π/nπ/n → 1

Simplify the expression on the left by inverting the ratio:

π/n→0lim nπ [sin π/n] → 1

Multiply both sides of the expression by π:

π/n→0lim n [sin π/n] → π

Calculations

First, let us take n = 6:

sin(π/n) = sin(π/6) = 0.5

n sin(π/n) = 6 x 0.5 = 3.0

Therefore, π must be greater than 3.0. If we take iterations of n by doubling the value 6 to 12, then 12 and so forth, we can create a table that follows.

Table

#nsin(π/n)n sin(π/n)
160.5003.000000
2120.2593.105829
3240.1313.132629
4480.0663.139350
5960.0333.141032
61920.0163.141452
73840.0083.141558
87680.0043.141584
91,5360.0023.141590
103,0720.0013.141592
116,1440.00053.141593
1212,2880.00033.141593

Note: after 11 iterations, π has been calculated to six decimal points.

Graph

Graph


3. Using Integral Calculus

Key

CCircumference
ddiameter
rradius
AArea, in this case half a circle

Formulae

C = 2 π r

A = π r2

½ A = π r22

r = 1

½ A = π2

x2 + y2 = r2

Solve this as a function of x:

f(x) = sqrt(r2 - x2)

f(x) = sqrt(1 - x2)

Take the integral from -1 to 1, which is ½ A:

π2 = ∫ -1 1 1 - x2 dx

π = 2 ∫ -1 1 1 - x2 dx

If you divide the area by 0.5 increments, and use the above formula to calculate the height of each rectangle, you shall have four areas to measure to produce the following table:

Table, divide the half circle by 4 rectangles

xx-difff(x)An
-10.000
-0.50.50.8660.433
00.51.0000.500
0.50.50.8660.433
10.50.0000.000
½π1.366
π2.732

Continue by creating 8 rectangles under the half circle:

Table, divide the half circle by 8 rectangles

xx-difff(x)An
-1
-0.750.250.6610.165
-0.50.250.8660.217
-0.250.250.9680.242
00.251.0000.250
0.250.250.9680.242
0.50.250.8660.217
0.750.250.6610.165
10.250.0000.000
½π1.498
π2.996

You will notice quickly that the value of π is increasing. You can continue the process repeatedly until you have has many digits of accuracy as you wish. In my case, I shall continue until I have 6 digits:

Table, iterating the area of a half circle, then multiply by 2

Continue by creating 16 rectangles:

Table, divide the half circle by 16 rectangles

xx-difff(x)An
-1
-0.8750.1250.4840.061
-0.750.1250.6610.083
-0.6250.1250.7810.098
-0.50.1250.8660.108
-0.3750.1250.9270.116
-0.250.1250.9680.121
-0.1250.1250.9920.124
00.1251.0000.125
0.1250.1250.9920.124
0.250.1250.9680.121
0.3750.1250.9270.116
0.50.1250.8660.108
0.6250.1250.7810.098
0.750.1250.6610.083
0.8750.1250.4840.061
10.1250.0000.000
½π1.545
π3.090

Continue dividing until you reach the desired number of digits:

Table, with divisions (Div) and the value of pi (π)

Divπ
42.732051
82.995709
163.089819
323.123253
643.135102
1283.139297
2563.140781
5123.141306
10243.141491
20483.141557
40963.141580
∞3.141593

Graph

 


4. Using Polygons

Key

CCircumference
CiCircumference, inner polygon
CoCircumference, outer polygon
ddiameter
rradius
xipoint x-inner value
yipoint y-inner value
xopoint x-outer value
yopoint y-outer value
liline, inner value, inside the circle
loline, outer value, outside the circle
θtheta, angle at the center
θitheta, inner angle at the center
θotheta, outer angle at the center
ψpsi, angle at the periphery near the circle
ψipsi, inner angle at the periphery
ψopsi, outer angle at the periphery

Method

Take a generic polygon, say the Pentagon, and define the inner line (li) and the outer line(lo). Calculate each of these values and multiply by the number of divisions: in this case 5. The inner lines give the lower limit and the outer lines give the upper limit of π. Take higher orders of polygons to narrow the range.

Formulae

sin θi = yi

sin ψi = yili

sin θo = yo

sin ψo = yo½ lo

r = 1

π = Cd = C2r

Calculations

Inner Pentagon

θi = 72° = 1.257 rads

sin θi = yi

sin (1.257) = yi

yi = 0.951

sin ψi = yili

ψi = 54° = 0.942 rads

li = yisin ψi = 0.951sin(0.942) = 1.176

Ci = 5 li = 5 x 1.176 = 5.878

πi = Ci2r = 5.8782 = 2.940

Outer Pentagon

θo = 36° = 0.628 rads

sin θo = yo

sin (0.628) = yo = 0.588

ψo = 54° = 0.942 rads

lo = 2 yosin ψo = 2 x 0.588sin(0.942) = 1.453

Co = 5 lo = 5 x 1.453 = 7.265

πo = Co2r = 7.2652 = 3.633

Therefore:

πi < π < πo

2.939772 < π < 3.632713

Note: you can do the same calculations for a series of polygons and create the following tables:

Table of Angles used in the calculations

nPolygonθiψiθoψo
3Triangle6060
4Square4545
5Pentagon72543654
6Hexagon60603060
7Heptagon51.4364.2925.7164.29
8Octagon4567.5022.567.5
9Nonagon40702070
10Decagon36721872

Table of Calculations using Polygons

nπirangeπo
32.598076< π <5.196152
42.828427< π <4.000000
52.938926< π <3.632713
63.000000< π <3.464102
73.037186< π <3.371022
83.061467< π <3.313708
93.078181< π <3.275732
103.090170< π <3.249197

Graph

Graph


Special Case of the Triangle and Square

You will notice that the triangle and square represent special cases with regards to the polygons. The calculations are included here for completeness.

Triangle

Inner Triangle

θ = θi

θi = 60° = 1.047 rads

sin θi = yi

sin(1.047) = yi = 0.866

Ci = 6 x 0.866 = 5.196

πi = Ci2r = 5.1962 = 2.598076

Outer Triangle

θ = θo

θo = 60° = 1.047 rads

sin θo = yor + lv

cos θo = rr + lv

Solving for (r+lv):

r + lv = yosin θo

r + lv = yocos θo

Then, equating the two expressions gives:

yo = sin θocos θo

yo = sin(1.047)cos(1.047) = 1.732

Co = 6 x 1.732 = 10.392

πi = Co2r = 10.3922 = 5.196152

Square

Inner Square

θ = 45° = 0.785 rads

sin θ = yi

sin(0.785) = yi = 0.707

Ci = 8 x yi = 8 x 0.707 = 5.657

πi = Ci2r = 5.6572 = 2.828427

Outer Square

yo = r

Co = 8 x r = 8 x 1 = 8

πo = Ci2r = 82 = 4.000000


5. Precision

I have calculated π to six decimal places: 3.141593. π to 9 decimal places is 3.141592654. The difference between these two values is 346 x10-9, or a ratio of 1:2,890,173.412, or roughly 1 in 3 million! This begs the question, how precise do you need to be?

In 1873, William Shanks calculated π to 527 decimal points. According to Live Science and ScienceAlert, π has been calculated to 314 trillion digits using a Dell PowerEdge R7725 server. These are just exercises of endurance and prestige, respectively. According to NASA, they need to use π to 15 decimal places (3.141592653589793) for interplanetary navigation.

According to Wikipedia, the following is a timeline with regards to the accuracy of calculations of π:

top of page