Skip to content

Instantly share code, notes, and snippets.

@gvitalie
Last active September 19, 2025 09:07
Show Gist options
  • Save gvitalie/d21369f1aefc9b8d04ca9aadbd64ec14 to your computer and use it in GitHub Desktop.
Save gvitalie/d21369f1aefc9b8d04ca9aadbd64ec14 to your computer and use it in GitHub Desktop.
Euler and Newton relations make a tandem 🚲 to calculate Ο€ value, using successive exponential tangent.
me@amadeus:~$ python3 -q
>>>
>>> import cmath
>>>
>>> a = 3
>>> for i in range(3):
... a -= cmath.exp(a * 1j).imag/cmath.exp(a * 1j).real
...
>>>
>>> print(a)
3.141592653589793
>>>
>>> # &β€’
>>>
me@amadeus:~$
@gvitalie
Copy link
Author

gvitalie commented Sep 19, 2025

Aa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment