Specifications

Section 8. Processing and Math Instructions
8-5
ATN FunctionExample
The example uses ATN to calculate π. By definition, a full circle is 2π radians.
ATN(1) is π/4 radians (45 degrees).
Dim Pi 'Declare variables.
Pi = 4 * Atn(1) 'Calculate Pi.
ATN2(Y, X)
The ATN2 function returns the arc tangent of y/x.
Syntax
x = ATN2 ( Y, X )
Remarks
ATN2 function calculates the arctangent of Y/X returning a value in the range
from π to -π radians, using the signs of both parameters to determine the
quadrant of the return value. ATN2 is defined for every point other than the
origin (X = 0 and Y = 0). Y and X can be variables, constants, or expressions.
To convert degrees to radians, multiply degrees by π/180. To convert radians
to degrees, multiply radians by 180/π.
Pi/2
-Pi/2
Pi
0
+y
+x
-x
-y
ATN2 is the inverse trigonometric function of TAN, which takes an angle as
its argument and returns the ratio of two sides of a right triangle. Do not
confuse ATN2 with the cotangent, which is the simple inverse of a tangent
(1/TAN).
ATN2 Function Example
The example uses ATN2 to calculate π. By definition, a full circle is 2π
radians. ATN2(1,1) is π/4 radians (45 degrees).
Dim Pi 'Declare variables.
Pi = 4 * ATN2( 5, 5 ) 'Calculate Pi.