Forum



How to caculate Pi
8 replies



http://en.wikipedia.org/wiki/Pi
Assuming that the unit circle within the first quadrant takes up 1/4 of the area, we can find the actual value of pi by finding the definite form of
1
4*int(sqrt(1-x^2)) from 0 to 1
1
2
3
2
3
sin(t) = x cos(t) = sqrt(1-x^2) dx = cos(t)dt
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
4*int(cos^2(t)dt) -> sin(t)cos(t) + int(sin^2(t)) = int(cos^2(t)) Where cos^2(t) = 1- sin^2(t) 2int(sin^2) = t - sin(t)cos(t) => 2int(cos^2) = t + sin(t)cos(t) (From trig identity)
1
2
3
4
5
2
3
4
5
2(t+sin(2t)/2) -> (sintcost = sin(2t)/2) Where t = arcsin(x) [2arcsin(x) + xsqrt(1-x^2)/2]0=>1
For both ends, the second term becomes zero, hence:
pi = 2arcsin(1) (This makes sense, sin(pi/2) = 1)
The taylor expansion of arcsin at x0=0 is:
1
arcsin(x) = sum from 0 to infinity of (2n)!/(4^n (n!)^2 (2n+1)) * (x^(2n+1))
See http://en.wikipedia.org/wiki/Taylor_series for more information.
Alternatively, you can just bruteforce a more simplistic pragmatic discrete integral of sqrt(1-x^2) directly within the program.
And Pi has many different way to calculate it not just the usual circle / radius. As you can see by Lee's example. If you are using Python to program this or any other high-level language, google "mathematical module" + the name of your language to get the more complex commands ( like: cosine, tangent, etc ).
1
pi=4/(1+(1^2/(2+3^2/(2+5^2/2+7^2/etc))))
Space of a circle / radius in the second degree
Silent_Control has written
There was also a formula like
You have to add more 2+(2k+1)^2 fractions for more decimals.
1
pi=4/(1+(1^2/(2+3^2/(2+5^2/2+7^2/etc))))
This is the product expansion of the McClaurine series for either arcsin or arctan into a continuous fraction and is also a viable method for estimating pi. However the proof of this is very high level math, as are the techniques needed to test and solve for the convergence of this product series. (then again, we also have computers that can do dumb calculations)



