Skip to content

Instantly share code, notes, and snippets.

View gvitalie's full-sized avatar
🌻

Vitalie Ghelbert gvitalie

🌻
View GitHub Profile
@gvitalie
gvitalie / ❄.py
Last active September 19, 2025 09:07
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)
@gvitalie
gvitalie / e^x.py
Created September 17, 2025 15:33
e^x
me@amadeus:~$ python3 -q
>>>
>>> import cmath
>>>
>>> a = 3
>>> for i in range(3):
... a += cmath.exp(a * 1j).imag
...
>>> print(a)
3.141592653589793
@gvitalie
gvitalie / 😇.py
Created September 13, 2025 14:43
😇
import math
def sin(x):
a = 0
for i in range(30):
a += ((-1) ** i) * (x ** (2*i+1)) / math.factorial(2*i+1)
return a
a = 3
for i in range(3):
@gvitalie
gvitalie / π.py
Created September 13, 2025 09:06
π
me@amadeus:~$ python3 -q
>>>
>>> from math import sin
>>>
>>> a = 3
>>> for i in range(3):
... a += sin(a)
...
>>> print(a)
3.141592653589793