On this page
  1. cmath.rect
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

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

REPL Inspect

from cmath import rect
help(rect)

Linked from

Related notes