steve_bank
Diabetic retinopathy and poor eyesight. Typos ...
Moved a discussion from a software thread. A review of complex numbers.
The identity look simple but it appears widely in technology. One benefit is managing complex numbers in an experiential form where the laws of exponents apply instead of arithmetic in rectangular form.
x^a * x^b = x ^(a+b)
x^a \ x^b = x^(a-b)
e^ja * e^ja = e ^(ja+jb)
e^ja \ e^ja = e ^(ja-jb)
(cos(x1) + jsin(x1))*(cos(x12) + jsin(x2)) = e^(jx1 + jx2)
(cos(x1) + jsin(x1))/(cos(x12) + jsin(x2)) = e^(jx1 - jx2)
In Python
Euler's identity - Wikipedia
en.wikipedia.org
The identity look simple but it appears widely in technology. One benefit is managing complex numbers in an experiential form where the laws of exponents apply instead of arithmetic in rectangular form.
x^a * x^b = x ^(a+b)
x^a \ x^b = x^(a-b)
e^ja * e^ja = e ^(ja+jb)
e^ja \ e^ja = e ^(ja-jb)
(cos(x1) + jsin(x1))*(cos(x12) + jsin(x2)) = e^(jx1 + jx2)
(cos(x1) + jsin(x1))/(cos(x12) + jsin(x2)) = e^(jx1 - jx2)
In Python
Code:
import math as ma
import cmath as cm
x1 = 10
x2 = 20
y1 = cm.cos(x1) + 1j*cm.sin(x1)
y2 = cm.cos(x2) + 1j*cm.sin(x2)
ye1 = cm.exp(1j*x1)
ye2 = cm.exp(1j*x2)
print("checking Euler's fidentity")
print("rectangular cos(x) + jsin(x)")
print("%f %fj " %(y1.real,y1.imag))
print("%f %fj " %(y2.real,y2.imag))
print("exponential e^jx")
print("%f %fj " %(ye1.real,ye1.imag))
print("%f %fj " %(ye2.real,ye2.imag))
print("\n")
ym = y1 * y2
yd = y1/y2
yem = ye1 * ye2
yed = ye1/ye2
print("mult div in rectangular form")
print("%f %fj " %(ym.real,ym.imag))
print("%f %fj " %(yd.real,yd.imag))
print("mult div in exponential form")
print("%f %fj " %(yem.real,yem.imag))
print("%f %fj " %(yed.real,yed.imag))
print("\n")
em = cm.exp(1j*x1+1j*x2)
ed = cm.exp(1j*x1-1j*x2)
print("Laws Of Exponents")
print("%f %fj " %(em.real,em.imag))
print("%f %fj " %(ed.real,ed.imag))
Code:
checking Euler's fidentity
rectangular cos(x) + jsin(x)
-0.839072 -0.544021j
0.408082 0.912945j
exponential e^jx
-0.839072 -0.544021j
0.408082 0.912945j
mult div in rectangular form
0.154251 -0.988032j
-0.839072 0.544021j
mult div in exponential form
0.154251 -0.988032j
-0.839072 0.544021j
Laws Of Exponents
0.154251 -0.988032j
-0.839072 0.544021j