On this page
cmath.polar
Prev: cmath.phase | Up: cmath | Next: cmath.rect
Rel: cmath.acos, cmath.acosh, cmath.asin, cmath.asinh
Ref: docs.python.org — cmath.polar
Tags: #public #python3 #stdlib #cmath
Import
import cmath
from cmath import polar
Signature & Overview
cmath.polar(z, /)
Convert a complex from rectangular coordinates to polar coordinates.
Usage
import cmath
r, phi = cmath.polar(3 + 4j)
assert cmath.isclose(r, 5.0) and isinstance(phi, float)
Gotchas
- Returns
(abs(z), phase(z)): Inverse ofcmath.rect(r, phi).
REPL Inspect
from cmath import polar
help(polar)
Linked from
Related notes
- tuts/python3/stdlib_module/cmath/phase Linked here; links to this page; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/rect 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