Python cmath.polar() Method

❮ cmath Methods


Example

Convert a complex number to polar coordinates form:

#import cmath for complex number operations
import cmath

#find the polar coordinates of complex number
print (cmath.polar(2 + 3j))
print (cmath.polar(1 + 5j))
Try it Yourself »

Definition and Usage

The cmath.polar() method converts a complex number to polar coordinates. It returns a tuple of modulus and phase.

In polar coordinates, a complex number is defined by modulus r and phase angle phi.


Syntax

cmath.polar(x)

Parameter Values

Parameter Description
x Required. A number to find polar coordinates of

Technical Details

Return Value: A tuple value, representing polar coordinates
Python Version: 2.6

❮ cmath Methods

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.