You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Native python pow() can take complex numbers: >>> pow((0+1j), 2) squaring i (-1+0j) results in -1
However, processing's pow() cannot, and thus print(pow((0+1j), 2)) exact same function but in a print function
results in nothing being printed and nothing else after that line will be run
And it's not print()'s fault, because print(complex(1,1)) results in (1+1j) and everything after is run
The text was updated successfully, but these errors were encountered:
Partially solved by making my own complex power function:
defcpow(z,n): # z^n where z ∈ ℂ, n ∈ ℤre=z.realim=z.imagr=sqrt(re**2+im**2) # magnitude of zc=atan(im/re) # angle of zy=r**n* (cos(n*c)+sin(n*c)*1j) # r^n ⋅ (cos(nc)+isin(nc))returny
Native python
pow()
can take complex numbers:>>> pow((0+1j), 2)
squaring i(-1+0j)
results in -1However, processing's
pow()
cannot, and thusprint(pow((0+1j), 2))
exact same function but in a print functionresults in nothing being printed and nothing else after that line will be run
And it's not
print()
's fault, becauseprint(complex(1,1))
results in(1+1j)
and everything after is runThe text was updated successfully, but these errors were encountered: