• We should now be fully online following an overnight outage. Apologies for any inconvenience, we do not expect there to be any further issues.

What is the formula to find Pi?

alfa147x

Lifer
Jul 14, 2005
29,307
106
106
How would i be able to plug this into a java application, i just want to calculate it and display it, and watch it grow.
 

txrandom

Diamond Member
Aug 15, 2004
3,773
0
71
Math.PI, convert it to a string, display a one character substring, 2 char substring, 3 char substring, etc...
 

alfa147x

Lifer
Jul 14, 2005
29,307
106
106
Originally posted by: Cawchy87
Originally posted by: alfa147x
How would i be able to plug this into a java application, i just want to calculate it and display it, and watch it grow.


you can estimate the value of pi using series

how would i be able to do that? I'm new to java
 

txrandom

Diamond Member
Aug 15, 2004
3,773
0
71
Or you can try:

Sum from n=0..infinity. ((-1) ^ N ) / (2n + 1) = pi/4. So multiply that by 4 to get Pi.
 

Cawchy87

Diamond Member
Mar 8, 2004
5,104
2
81
Originally posted by: alfa147x
Originally posted by: Cawchy87
Originally posted by: alfa147x
How would i be able to plug this into a java application, i just want to calculate it and display it, and watch it grow.


you can estimate the value of pi using series

how would i be able to do that? I'm new to java

Sorry man, I know math. But nothing about java

 

txrandom

Diamond Member
Aug 15, 2004
3,773
0
71
I can write a small program to do it if you are interested. It uses Leibnez Series.
 

alfa147x

Lifer
Jul 14, 2005
29,307
106
106
Originally posted by: txrandom
I can write a small program to do it if you are interested. It uses Leibnez Series.

Nah, thanks for the offer. i like the feeling when i run my applications. Could you help me sudo code it?
Originally posted by: BoomerD
Follow nose, open cupboard...find pie...eat and enjoy.

i found empty plates, and pots and other stuff .... :(


 

Adn4n

Golden Member
Aug 6, 2004
1,043
0
0
I vaguely remember this from CS class, but wasn't it found through Fibonacci series.