HTBasic Help
×
Menu
Index

ATN

Returns the arctangent of an expression.
 
 ATN( numeric-expression )
 
Usage:
C2=ATN(4.5)
PRINT "Angle = ";ATN(Ang1)
 
Example:      ATN.BAS
 
Description:
The arctangent of a number is the angle whose tangent is that number. ATN returns a value between ±PI/2 radians or ±90 degrees, depending on the current trigonometric mode. The default trigonometric mode is RAD. Use DEG to change to degrees.
 
COMPLEX Arguments
ATN accepts either a COMPLEX or REAL argument and returns a value of the same type. For COMPLEX arguments the angle is returned in radians, regardless of the current trigonometric mode. ATN returns the principal value, defined (in terms of complex arithmetic) as
 
ATN(Z) = CMPLX(0,1/2)*LOG((CMPLX(0,1)+Z)/(CMPLX(0,1)-Z))
 
which returns a real part in the range -PI/2 to PI/2. The domain for COMPLEX arguments includes all points in the complex plane except CMPLX(0,1). Notice that intermediate values generated during the calculation of the function can cause over or underflow errors for very large or small values of Z.
 
See Also: