beautypg.com

Remote Processing CAMBASIC User Manual

Page 39

background image

Comm ands - 6

ATN

Numeric Fun ction

SYNTAX:

n = A T N (m)

PURPOSE:

To return the arctangent of m.

REMARK S:

The r esult, n, of the AT N function is a value in radians in the range of – PI/2 to PI/ 2, wher e PI =
3.1 41593. The expr ession ma y be integer , bu t the evaluation is alw ays perf orm ed in floating poin t.

T o o bt a in th e ta n ge n t o f m w h e n m i s i n d e gr e e s, u s e T A N (m*

B

180).

Trigo nometr ic functions ar e compu ted as a pow er ser ies in CA MBA SIC. Calculation s are don e in
single precision floating point to seven digits of precision. Since the power series is an
a p pr o x im a ti on , t he r e su lt w il l b e ac c ur a te to f ou r to s ix d ig it s, d e p en d in g up o n t he v al ue o f 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