How to calculate the phase of a complex number in Python

1 Answer

0 votes
import cmath

z = complex(3, -5)
print(cmath.phase(z))

z = complex(-1.0, 0.0)
print(cmath.phase(z))




 
'''
run:
 
-1.0303768265243125
3.141592653589793
 
'''

 



answered Apr 25, 2021 by avibootz

Related questions

1 answer 172 views
172 views asked Apr 25, 2021 by avibootz
1 answer 192 views
1 answer 153 views
153 views asked Apr 25, 2021 by avibootz
1 answer 253 views
1 answer 236 views
1 answer 245 views
...