On this page
cmath.rect
Prev: cmath.polar | Up: cmath | Next: cmath.sin
Rel: cmath.acos, cmath.acosh, cmath.asin, cmath.asinh
Ref: docs.python.org — cmath.rect
Tags: #public #python3 #stdlib #cmath
Import
import cmath
from cmath import rect
Signature & Overview
cmath.rect(r, phi, /)
Convert from polar coordinates to rectangular coordinates.
Usage
import cmath
z = cmath.rect(2.0, cmath.pi / 2)
assert cmath.isclose(z, 2j, abs_tol=1e-12)
Gotchas
- Constructs
r * (cos(phi) + 1j * sin(phi))from polar coordinates(r, phi)in radians.
REPL Inspect
from cmath import rect
help(rect)
Linked from
Related notes
- tuts/python3/stdlib_module/cmath/polar Linked here; links to this page; shared tags: #cmath, #stdlib
- tuts/python3/stdlib_module/cmath/sin 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