Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

complex phase python

# calc the magnitude (abs) and the phase of a complex number 
from cmath import phase # No need to import abs()

c = 1 + 2j
print(abs(c)) # Should print 2.23606797749979
print(phase(c)) # Should print 1.1071487177940904
 
PREVIOUS NEXT
Tagged: #complex #phase #python
ADD COMMENT
Topic
Name
6+5 =