New Posts  All Forums:Forum Nav:

How to calculate pi? - Page 2

post #11 of 35
There probably isn't any "quickest" algorithm for finding pi, but
there are many and varied ones. Another one you might try is;

pi/2 = 2/1 x 2/3 x 4/3 x 4/5 x 6/5 x 6/7 x 8/7 x 8/9 ...

This is one of the simplest (can you see the pattern that is
developing between the odd and even numbers in the numerators and
denominators?) and was discovered by John Wallis (1616-1703).

There is a book published by St. Martin's Press called _A History of
Pi_ by Petr Beckmann that has much about pi and the attempts to
calculate it. Also, In Martin Gardner's _New Mathematical Diversions_
From Scientific American, a Fireside Book published by Simon and
Schuster, he has a very interesting chapter on pi and some of its
history.

-Doctor Bill, The Math Forum


source

Neato... an element of Mathmatics that is operating in the background that defies definition...(?)
Flux
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K GA-P67A-UD7 GTX 580 2 x 2GB Corsair 
Hard DriveOptical DriveOSMonitor
C300 (OS), Velociraptor (storage) Lite-On W7 64-bit Pro Samsung 275T 
KeyboardPowerCaseMouse
Black Widow Ult. Silverstone DA750 Lian Li T60 R.A.T. 7 
Mouse Pad
Q-Pad 
  hide details  
Reply
Flux
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K GA-P67A-UD7 GTX 580 2 x 2GB Corsair 
Hard DriveOptical DriveOSMonitor
C300 (OS), Velociraptor (storage) Lite-On W7 64-bit Pro Samsung 275T 
KeyboardPowerCaseMouse
Black Widow Ult. Silverstone DA750 Lian Li T60 R.A.T. 7 
Mouse Pad
Q-Pad 
  hide details  
Reply
post #12 of 35
I don't understand why you can't use fractions, that's the easiest way to do it. I recently had a programming assignment involving the calculation of pi and that's what I used.
Way too expensive
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8500 4.27GHz 24/7 EP45-DS3L HD4850 GSKill 1000 
Hard DriveOSMonitorPower
640Gig WD Vista Ultimate 32bit Samsung 22" Widescreen 650W Corsair 
Case
Antec 300 
  hide details  
Reply
Way too expensive
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8500 4.27GHz 24/7 EP45-DS3L HD4850 GSKill 1000 
Hard DriveOSMonitorPower
640Gig WD Vista Ultimate 32bit Samsung 22" Widescreen 650W Corsair 
Case
Antec 300 
  hide details  
Reply
post #13 of 35
Thread Starter 
Quote:
Originally Posted by Syrillian View Post
There probably isn't any "quickest" algorithm for finding pi, but
there are many and varied ones. Another one you might try is;

pi/2 = 2/1 x 2/3 x 4/3 x 4/5 x 6/5 x 6/7 x 8/7 x 8/9 ...

This is one of the simplest (can you see the pattern that is
developing between the odd and even numbers in the numerators and
denominators?) and was discovered by John Wallis (1616-1703).

There is a book published by St. Martin's Press called _A History of
Pi_ by Petr Beckmann that has much about pi and the attempts to
calculate it. Also, In Martin Gardner's _New Mathematical Diversions_
From Scientific American, a Fireside Book published by Simon and
Schuster, he has a very interesting chapter on pi and some of its
history.

-Doctor Bill, The Math Forum


source

Neato... an element of Mathmatics that is operating in the background that defies definition...(?)
Problem is allot of those sum to infinite repeating numbers.

Quote:
Maybe this Link will help! http://www.cs.uwaterloo.ca/~alopez-o...aq/node38.html
When i realised i had no idea what that big E lookalike symbol meant i knew that page was my worst nightmare.
Lee XT
(17 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-6300 Asus M5A97 SAPPHIRE Radeon HD 7850 AMD 4GB DDR3 1333MHZ 
RAMRAMRAMHard Drive
AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ OCZ Vertex 4 256GB 
CoolingOSMonitorKeyboard
Corsair H80 Windows 8.1 Pro MCE Dell P2414H WHXV7  Microsoft Generic 
PowerCaseMouseMouse Pad
Ultra 600W Limited Edition NZXT Black Steel Razer Deathadder Razer Goliath 
Audio
Realtek HD Audio 
  hide details  
Reply
Lee XT
(17 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-6300 Asus M5A97 SAPPHIRE Radeon HD 7850 AMD 4GB DDR3 1333MHZ 
RAMRAMRAMHard Drive
AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ OCZ Vertex 4 256GB 
CoolingOSMonitorKeyboard
Corsair H80 Windows 8.1 Pro MCE Dell P2414H WHXV7  Microsoft Generic 
PowerCaseMouseMouse Pad
Ultra 600W Limited Edition NZXT Black Steel Razer Deathadder Razer Goliath 
Audio
Realtek HD Audio 
  hide details  
Reply
post #14 of 35
Quote:
Originally Posted by rsfkevski View Post
A = pi*r^2

There ya go
i tried that in JBASIC and it crashed the program
Dell 531
(13 items)
 
  
CPUMotherboardGraphicsRAM
Athlon 64 x2 +3800 Dell - Unknown GeForce 6150SE nForce 430 2.02 DRR2 
Hard DriveOptical DriveOSMonitor
250 GB 3.0 GB/s samsung 20X speed dvd-+ rw Windows XP pro and Vista 19 inch LCD display 
KeyboardPowerCaseMouse
Dell 400 Ws Mid Tower Dell 
Mouse Pad
None 
  hide details  
Reply
Dell 531
(13 items)
 
  
CPUMotherboardGraphicsRAM
Athlon 64 x2 +3800 Dell - Unknown GeForce 6150SE nForce 430 2.02 DRR2 
Hard DriveOptical DriveOSMonitor
250 GB 3.0 GB/s samsung 20X speed dvd-+ rw Windows XP pro and Vista 19 inch LCD display 
KeyboardPowerCaseMouse
Dell 400 Ws Mid Tower Dell 
Mouse Pad
None 
  hide details  
Reply
post #15 of 35
What you need is a Pi Algorithm, not a formula
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
post #16 of 35
Good luck Licht. I think that figuring out a means to calculate pi and program it is a very good challenge to a beginning programmer.
    
CPUMotherboardGraphicsRAM
Xeon E5645 Asus Rampage II Gene eVGA GTX460 SSC 3x4GB Corsair Dominator PC3-12800 
Hard DriveHard DriveHard DriveOS
Crucial C300 64GB Seagate Momentus XT 750 Western Digital GP 2TB EARS Windows 7 Premium 
MonitorKeyboardPowerCase
Asus VE278Q DSI SMK-88 Seasonic X-660 Lian Li U6B 2011 SE 
MouseMouse Pad
Logitech G500 KAI.g3 HIEN - HARD 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Xeon E5645 Asus Rampage II Gene eVGA GTX460 SSC 3x4GB Corsair Dominator PC3-12800 
Hard DriveHard DriveHard DriveOS
Crucial C300 64GB Seagate Momentus XT 750 Western Digital GP 2TB EARS Windows 7 Premium 
MonitorKeyboardPowerCase
Asus VE278Q DSI SMK-88 Seasonic X-660 Lian Li U6B 2011 SE 
MouseMouse Pad
Logitech G500 KAI.g3 HIEN - HARD 
  hide details  
Reply
post #17 of 35
3.14159265358979

I know it up to there my heart. Hooray for me.
    
CPUMotherboardGraphicsRAM
i7 4790k @ 4.7GHz Asus Z97 Pro Gaming EVGA 1080 Ti FTW3 @ 2050 MHz 32GB G Skill Sniper DDR3-2133 
Hard DriveHard DriveHard DriveOptical Drive
Intel 600p m.2 512GB Crucial M500 SSD 960GB Toshiba X300 HDD 3TB LG Blu Ray Burner 
CoolingOSMonitorMonitor
Cooler Master Nepton 240m Windows 10 Pro Samsung 34" Curved Ultrawide (3440x1440) Samsung 22" Portrait (1080x1920) 
KeyboardPowerCaseMouse
Poker II Cherry MX Brown, KBParadise V80 Cherry... EVGA G2 650W Cooler Master Silencio 652s Steelseries Sensei Wireless 
Mouse PadAudioAudio
Tekmat SIG 556 SMSL Q5 Pro DAC Bowers & Wilkins DM601 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
i7 4790k @ 4.7GHz Asus Z97 Pro Gaming EVGA 1080 Ti FTW3 @ 2050 MHz 32GB G Skill Sniper DDR3-2133 
Hard DriveHard DriveHard DriveOptical Drive
Intel 600p m.2 512GB Crucial M500 SSD 960GB Toshiba X300 HDD 3TB LG Blu Ray Burner 
CoolingOSMonitorMonitor
Cooler Master Nepton 240m Windows 10 Pro Samsung 34" Curved Ultrawide (3440x1440) Samsung 22" Portrait (1080x1920) 
KeyboardPowerCaseMouse
Poker II Cherry MX Brown, KBParadise V80 Cherry... EVGA G2 650W Cooler Master Silencio 652s Steelseries Sensei Wireless 
Mouse PadAudioAudio
Tekmat SIG 556 SMSL Q5 Pro DAC Bowers & Wilkins DM601 
  hide details  
Reply
post #18 of 35
Quote:
Originally Posted by Licht View Post
Problem is allot of those sum to infinite repeating numbers.



When i realised i had no idea what that big E lookalike symbol meant i knew that page was my worst nightmare.
It's Sigma. It's not all that hard, but it is a ***** when you start using it with integrals and ln. Sigh, I am so going to fail the AP Calc BC test (keep on telling myself that so that I don't get c-o-c-k-y).

(by the way, why would that word go into filters?)

Like someone said earlier in this thread, you'll have to use floating point, pi is an irrational number, so 22/7 earlier in this thread was rather pointless as well.

If you understand series this might be of some help, it's in rather basic language:

http://www.cygnus-software.com/misc/pidigits.htm

Bit more in-depth description, but more complex:

http://clivo.altervista.org/Math/Calculating_PI.html


Good luck. It was one of the first things I learned over a summer when I was bored and yearned to learn programming. Because of that summer, I'm now going to Las Vegas for a Robotics Tourney.
Sager NP8150
(13 items)
 
  
CPUGraphicsRAMHard Drive
Intel i7-2630QM (@ 2.0 ghz) ATI 6990m 2 Gigs Mem 8 Gigs DDR3 @ 1333 750GB (7200RPM) 
Optical DriveOSMonitorPower
Blu-ray reader/DVD burner Ubuntu 11.04; Win 7 15.6” (1920x1080) a really big brick 
  hide details  
Reply
Sager NP8150
(13 items)
 
  
CPUGraphicsRAMHard Drive
Intel i7-2630QM (@ 2.0 ghz) ATI 6990m 2 Gigs Mem 8 Gigs DDR3 @ 1333 750GB (7200RPM) 
Optical DriveOSMonitorPower
Blu-ray reader/DVD burner Ubuntu 11.04; Win 7 15.6” (1920x1080) a really big brick 
  hide details  
Reply
post #19 of 35
He will probably not need to use floating point. Floating point has good accuracy, but for something like this the precision is ridiculously small. He needs a datatype that allows an arbitrary number of digits (similar to BigInteger in java)
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
post #20 of 35
Thread Starter 
Quote:
Originally Posted by rabidgnome229 View Post
He will probably not need to use floating point. Floating point has good accuracy, but for something like this the precision is ridiculously small. He needs a datatype that allows an arbitrary number of digits (similar to BigInteger in java)
Could use a 64bit Integer to hold the decimal value, then add 3. to the beginning when displaying it for any reason.

Quote:
It's Sigma. It's not all that hard, but it is a ***** when you start using it with integrals and ln. Sigh, I am so going to fail the AP Calc BC test (keep on telling myself that so that I don't get c-o-c-k-y).

(by the way, why would that word go into filters?)

Like someone said earlier in this thread, you'll have to use floating point, pi is an irrational number, so 22/7 earlier in this thread was rather pointless as well.

If you understand series this might be of some help, it's in rather basic language:

http://www.cygnus-software.com/misc/pidigits.htm

Bit more in-depth description, but more complex:

http://clivo.altervista.org/Math/Calculating_PI.html

Good luck. It was one of the first things I learned over a summer when I was bored and yearned to learn programming. Because of that summer, I'm now going to Las Vegas for a Robotics Tourney.
Let's hope i'm so lucky!
Lee XT
(17 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-6300 Asus M5A97 SAPPHIRE Radeon HD 7850 AMD 4GB DDR3 1333MHZ 
RAMRAMRAMHard Drive
AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ OCZ Vertex 4 256GB 
CoolingOSMonitorKeyboard
Corsair H80 Windows 8.1 Pro MCE Dell P2414H WHXV7  Microsoft Generic 
PowerCaseMouseMouse Pad
Ultra 600W Limited Edition NZXT Black Steel Razer Deathadder Razer Goliath 
Audio
Realtek HD Audio 
  hide details  
Reply
Lee XT
(17 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-6300 Asus M5A97 SAPPHIRE Radeon HD 7850 AMD 4GB DDR3 1333MHZ 
RAMRAMRAMHard Drive
AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ OCZ Vertex 4 256GB 
CoolingOSMonitorKeyboard
Corsair H80 Windows 8.1 Pro MCE Dell P2414H WHXV7  Microsoft Generic 
PowerCaseMouseMouse Pad
Ultra 600W Limited Edition NZXT Black Steel Razer Deathadder Razer Goliath 
Audio
Realtek HD Audio 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming