| Thread Closed |
Calculating Pi |
Share Thread | Thread Tools |
| Mar20-05, 02:38 AM | #1 |
|
|
Calculating Pi
In what way can i calculate PI and output the result to the screen ?
I heard from my friedn that MC method is good but is there any other ways to do that ? also, how many decimal digits am I able to output the result ? Thank you in advance -KMCB1234 |
| Mar21-05, 10:01 PM | #2 |
|
|
Well for what purpose are you trying to calculate pi and what screen are you displaying it on??
|
| Mar21-05, 10:13 PM | #3 |
|
|
If you are trying to write something to test the speed of computer or machine... or if you just want a basic way of calculating pi
i might suggest since [tex] arctan(1)=\frac{\pi}{4} = 1 - \frac{1}{3}+\frac{1}{5}-\frac{1}{7}+\frac{1}{9}[/tex]... just multiply by 4 and have your program run a loop [tex] \pi= 4-\frac{4}{3}+\frac{4}{5}-\frac{4}{7}+\frac{4}{9}[/tex]... |
| Mar21-05, 10:17 PM | #4 |
|
|
Calculating Pi
Example code for TI-83
Pgrm Pi Clrhome 4>p 3>n 0>s lbl AA Disp "Pi",p If s=0 then p-(4/n)>p 1>s n+2>n goto AA End If s=1 then p+(4/n)>p 0>s n+2>n End Goto AA |
| Mar21-05, 10:18 PM | #5 |
|
|
That should work I haven't tested it I just wrote it... I wrote a similar program a long time ago and I think I did something similar. This isn't the quickest way to calculate pi but its a good one if you want to see digits slowly change into pi.
|
| Thread Closed |
| Thread Tools | |
Similar Threads for: Calculating Pi
|
||||
| Thread | Forum | Replies | ||
| calculating A in SHM from x, v & a | Introductory Physics Homework | 12 | ||
| Calculating Rv | Introductory Physics Homework | 7 | ||
| Calculating Ka | Biology, Chemistry & Other Homework | 2 | ||
| Re: Calculating v[t], x[t], | General Physics | 7 | ||
| Calculating dd.mm.ss | Calculus | 1 | ||