The cmath.polar()
function converts a complex number to polar coordinates. It returns a tuple of modulus and phase values.
The magnitude of the complex number is the square root of the sum of the squares of the real and imaginary parts. The angle is the angle in radians with the x-axis, counter-clockwise positive.
cmath.polar(x)
x |
The value(real or complex) to find polar coordinate of. If the argument is a real number, it is first converted into a complex number before the operation. |
The function returns a complex number representing the polar coordinates of the input complex number, x
.