cmath.polar()

cmath.polar(z) → r: float, phi: float

Convert a complex from rectangular coordinates to polar coordinates. r is the distance from 0 and phi the phase angle.