Python cmath.phase()メソッド
例
複素数の位相を見つけます。
#Import cmath Library
import cmath
#print phase of some given
parameters
print (cmath.phase(2 + 3j))
定義と使用法
このcmath.phase()
メソッドは、複素数の位相を返します。
複雑な数は、その大きさと角度で表すことができます。この角度はベクトル(複素数を表す)の間にあり、正のx軸は位相と呼ばれます。
注:出力は常に-πとπの間にあります。
構文
cmath.phase(x)
パラメータ値
Parameter | Description |
---|---|
x | Required. The number to find the phase of |
技術的な詳細
戻り値: | float 複素数の位相を表す値 |
---|---|
Pythonバージョン: | 2.62.6 |