Specifications
Commands - 5
ATN
Numeric Function
SYNTAX: n = ATN(m)
PURPOSE: To return the arctangent of m.
REMARKS: The result, n, of the ATN function is a value in radians in the range of –PI/2 to PI/2, where PI =
3.141593. The expression may be integer, but the evaluation is always performed in floating point.
To obtain the tangent of m when m is in degrees, use TAN (m* 180).
Trigonometric functions are computed as a power series in CAMBASIC. Calculations are done in
single precision floating point to seven digits of precision. Since the power series is an
approximation, the result will be accurate to four to six digits, depending upon the value of m.
RELATED: COS, SIN, TAN
EXAMPLE: 10 PI = 3.141593
20 RADIANS = ATN(1)
30 DEGREES = RADIANS * 180 / PI
40 PRINT RADIANS,DEGREES
RUN
.785398 45
ERROR: none