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))
定義と使用法
このcmath.polar()
メソッドは、複素数を極座標に変換します。モジュラスと位相のタプルを返します。
極座標では、複素数はモジュラスrと位相角phiによって定義されます。
構文
cmath.polar(x)
パラメータ値
Parameter | Description |
---|---|
x | Required. A number to find polar coordinates of |
技術的な詳細
戻り値: | tuple 極座標を表す値 |
---|---|
Pythonバージョン: | 2.62.6 |