cmath.phase() - cmath
Return the phase of x (also known as the argument of x), as a
float. phase(x) is equivalent to math.atan2(x.imag,
x.real). The result lies in the range [-Ï, Ï], and the branch
cut for this operation lies along the negative real axis,
continuous from above. On systems with support for signed zeros
(which includes most systems in current use), this means that the
sign of the result is the same as the sign of x.imag, even when
x.imag is zero:
Syntax
cmath.phase(x)
Example
>>> phase(complex(-1.0, 0.0))
3.141592653589793
>>> phase(complex(-1.0, -0.0))
-3.141592653589793
Output / Return Value
Limitations
Alternatives / See Also
Reference