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

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

REPL Inspect

from cmath import polar
help(polar)

Linked from

Related notes