用法:
cmath.phase(x)
返回
x
的相位(也稱為x
的argument
),作為浮點數。phase(x)
等同於math.atan2(x.imag, x.real)
。結果位於 [-π
,π
] 範圍內,此操作的分支切割位於負實軸上,從上方連續。在支持有符號零的係統上(包括當前使用的大多數係統),這意味著結果的符號與x.imag
的符號相同,即使x.imag
為零:>>> phase(complex(-1.0, 0.0)) 3.141592653589793 >>> phase(complex(-1.0, -0.0)) -3.141592653589793
相關用法
- Python cmath.phase()用法及代碼示例
- Python cmath.polar()用法及代碼示例
- Python cmath.isclose()用法及代碼示例
- Python cmath.log10()用法及代碼示例
- Python cmath.asinh()用法及代碼示例
- Python cmath.log()用法及代碼示例
- Python cmath.isnan()用法及代碼示例
- Python cmath.sinh()用法及代碼示例
- Python cmath.acosh()用法及代碼示例
- Python cmath.asin()用法及代碼示例
- Python cmath.acos()用法及代碼示例
- Python cmath.isinf()用法及代碼示例
- Python cmath.sin()用法及代碼示例
- Python cmath.atanh()用法及代碼示例
- Python cmath.tanh()用法及代碼示例
- Python cmath.exp()用法及代碼示例
- Python cmath.cosh()用法及代碼示例
- Python cmath.sqrt()用法及代碼示例
- Python cmath.isfinite()用法及代碼示例
- Python cmath.tan()用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 cmath.phase。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。