Python/ref cmath polar
来自菜鸟教程
<languages />
Python cmath.polar()方法
例
将复数转换为极坐标形式:
#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))
定义和用法
The
cmath.polar()
方法将复数转换为极坐标。它返回模量和相位的元组。
在极坐标中,复数由模数定义 r 和相位角 phi .
句法
cmath.polar(x)
参数值
| 参数 | 描述 |
|---|---|
| x | 需要。查找极坐标的数字 |
技术细节
| 返回值: | A
|
| Python版本: | 2.6 |