ATN2( )
Returns the inverse tangent (arctangent) of a given point.
Syntax
ATN2(<sine expN>, <cosine expN>)
<sine expN>
The sine of an angle. If <sine expN> is 0, <cosine expN> can't also be 0.
<cosine expN>
The cosine of an angle. If <cosine expN> is 0, <sine expN> can't also be 0. When <cosine expN> is 0 and <sine expN> is a positive or negative (nonzero) number, ATN2( ) returns +pi/2 or –pi/2, respectively.
Description
ATN2( ) returns the angle size in radians when you specify the sine and cosine of the angle. ATN2( ) returns a number from –pi to +pi radians. ATN2( ) returns 0 when <sine expN> is 0. When you specify 0 for both arguments, dBASE Plus returns an error.
To convert the returned radian value to degrees, use RTOD( ). For example, if the default number of decimal places is 2, ATN2(1,0) returns 1.57 radians while RTOD(ATN2(1,0)) returns 90.00 degrees.
Use SET DECIMALS to set the number of decimal places ATN2( ) displays.
ATN2( ) differs from ATAN( ) in that ATN2( ) takes the sine and cosine as the arguments, but ATAN( ) takes the tangent as the argument. See ATAN( ) for instructions on finding the arccotangent.