Machin's Equation is
4 arctan (1/5) - arctan(1/239) = pi/4
Using Python 3.1 and the math module:
from math import atan, pi
pi
3.141592653589793
(4*atan(.2) - atan(1/239))*4
3.1415926535897936
(4*atan(.2) - atan(1/239))*4 == pi
False
abs((4*atan(.2) - atan(1/239))*4) - pi
On Jan 9, 10:31 pm, Richard D. Moores rdmoo...@gmail.com wrote:
Machin's Equation is
4 arctan (1/5) - arctan(1/239) = pi/4
Using Python 3.1 and the math module:
from math import atan, pi
pi
3.141592653589793
(4*atan(.2) - atan(1/239))*4
3.1415926535897936
(4*atan(.2) -
En Sat, 09 Jan 2010 08:31:49 -0300, Richard D. Moores rdmoo...@gmail.com
escribió:
Is there a way in Python 3.1 to calculate pi to greater accuracy using
Machin's Equation? Even to an arbitrary number of places?
You may be interested in Demo/scripts/pi.py in the source distribution. It
On Jan 9, 11:31 am, Richard D. Moores rdmoo...@gmail.com wrote:
Is there a way in Python 3.1 to calculate pi to greater accuracy using
Machin's Equation? Even to an arbitrary number of places?
There's no arbitrary-precision version of atan included with Python.
You could write your own (e.g.,
On Jan 9, 11:31 am, Richard D. Moores rdmoo...@gmail.com wrote:
Machin's Equation is
4 arctan (1/5) - arctan(1/239) = pi/4
[...]
Is there a way in Python 3.1 to calculate pi to greater accuracy using
Machin's Equation? Even to an arbitrary number of places?
Here's some crude code (no error
On Sat, Jan 9, 2010 at 07:57, Mark Dickinson dicki...@gmail.com wrote:
On Jan 9, 11:31 am, Richard D. Moores rdmoo...@gmail.com wrote:
Machin's Equation is
4 arctan (1/5) - arctan(1/239) = pi/4
[...]
Is there a way in Python 3.1 to calculate pi to greater accuracy using
Machin's Equation?