On this page
cmath.phase
Prev: cmath.log10 | Up: cmath | Next: cmath.polar
Rel: cmath.acos, cmath.acosh, cmath.asin, cmath.asinh
Ref: docs.python.org — cmath.phase
Tags: #public #python3 #stdlib #cmath
Import
import cmath
from cmath import phase
Signature & Overview
cmath.phase(z, /)
Return argument, also known as the phase angle, of a complex.
Usage
import cmath
assert cmath.isclose(cmath.phase(-1 + 0j), cmath.pi)
assert cmath.isclose(cmath.phase(1j), cmath.pi / 2)
Gotchas
- Returns a
floatin[-pi, pi]: Equivalent tomath.atan2(z.imag, z.real).
REPL Inspect
from cmath import phase
help(phase)
Linked from
Related notes
- tuts/python3/stdlib_module/cmath/log10 Linked here; links to this page; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/polar Linked here; links to this page; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/cmath/acos Linked here; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/acosh Linked here; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/asin Linked here; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/asinh Linked here; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/atan shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/atanh shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/cos shared tags: #cmath, #stdlib