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