Python Tutorial Python Advanced Python Resources Python Libraries
Python Java C++ C C# PHP R SQL DS Algo InterviewQ

Python - cmath.polar() Function



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

Syntax

cmath.polar(x)

Parameters

x Required. Specify the number.

Return Value

Returns the representation of x in polar coordinates.

Example:

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

import cmath

x = 3 + 4j
print(cmath.polar(x))

The output of the above code will be:

(5.0, 0.9272952180016122)

❮ Python cMath Module

5