Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries

The Python cmath.polar() function is used to return the representation of x in polar coordinates. The function returns (r, θ) which is a polar representation of x, where r is is the modulus of x and θ is the phase of x. polar(x) is equivalent to (abs(x), phase(x)).




x Required. Specify the number.

Return Value

Returns the representation of x in polar coordinates.


In the below example, polar() function is used to representation the given complex number in polar coordinates.

import cmath

x = 3 + 4j

The output of the above code will be:

(5.0, 0.9272952180016122)

❮ Python cMath Module