Atan2関数

座標原点と指定点 (X, Y)を結ぶ直線の角度を返す関数です。単位はラジアンです。

書式
Atan2(X座標値, Y座標値)

パラメーター

X
X座標値を実数値で指定します。
Y
Y座標値を実数値で指定します。

戻り値
指定した座標のアークタンジェント値を返します。範囲は-π~πです。

解説
Atan2 (X, Y) は、座標原点 (0, 0)と([x座標値],[y座標値])とを結ぶ直線の角度を返す関数です。

この三角関数はすべての4つの四分円でアークタンジェント値 (角度)を返します。

参照
Abs, Acos, Asin, Atan, Cos, DegToRad, RadToDeg, Sgn, Sin, Tan, Val

Atan2関数使用例

Function at2test
  Real x, y
  Print "Please enter a number for the X Coordinate:"
  Input x
  Print "Please enter a number for the Y Coordinate:"
  Input y
  Print "Atan2 of ", x, ", ", y, " is ", Atan2(x, y)
Fend