Home >>Python cmath Module >Python cmath.polar() Method

Python cmath.polar() Method

Python cmath.polar() Method

Python cmath.polar() method in python is used to returns a tuple of modulus and phase and converts a complex number (defined by modulus r and phase angle phi) to polar coordinates.

Syntax:
cmath.polar(x)

Parameter Values

Parameter Description
x It is a required parameter to find polar coordinates of a given number
Here is an Example of Python cmath.polar() Method:

import cmath
print (cmath.polar(4 + 6j))
print (cmath.polar(2 + 1j))

Output:
(7.211102550927978, 0.982793723247329)
(2.23606797749979, 0.4636476090008061)
Example 2:

import cmath
print (cmath.polar(1 + 8j))

Output:
(8.06225774829855, 1.446441332248135)

No Sidebar ads