Python math.atan2()メソッド
例
y / xのアークタンジェントをラジアンで返します。
# Import math Library
import math
# Return the arc tangent of y/x
in radians
print(math.atan2(8, 5))
print(math.atan2(20, 10))
print(math.atan2(34, -7))
定義と使用法
このmath.atan2()
メソッドは、y / xのアークタンジェントをラジアンで返します。ここで、xとyは点(x、y)の座標です。
戻り値はPIと-PIの間にあります。
構文
math.atan2(y, x)
パラメータ値
Parameter | Description |
---|---|
y | Required. Specifies a positive or negative number |
x | Required. Specifies a positive or negative number |
技術的な詳細
戻り値: | ラジアンでy / xのアークタンジェントを表すfloat 値で、PIと-PIの間にあります |
---|---|
Pythonバージョン: | 1.4 |