Pythoncmath.polar() Method
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 »import cmath
#find the polar coordinates of complex number
print (cmath.polar(2 + 3j))
print (cmath.polar(1 + 5j))
Definition and Usage
Thecmath.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 modulusr and phase anglephi.
Syntax
cmath.polar(x)
Parameter Values
| Parameter | Description |
|---|---|
| x | Required. A number to find polar coordinates of |
Technical Details
| Return Value: | Atuple value, representing polar coordinates |
|---|---|
| Python Version: | 2.6 |

