Remote Processing CAMBASIC User Manual

Page 58

Advertising
background image

Comm ands - 25

COS

Numeric Fun ction

SYNTAX:

n = COS( m)

PURPOSE:

To return the trigonometr ic cosine function.

REMARK S:

m must be in radians. To conver t from degrees to radians, multiply by PI/180 where P I =
3.141593.

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
approximation, the r esult will be accurate to four to six digits, depending upon the value of m.

RELATED:

ATN, SIN, TAN

EXAMPLE:

10 PI = 3.141593
20 PRINT COS(PI)
30 DEGREES = 180
40 RADIANS = DEGREES * PI/180
50 PRINT COS(RADIANS)
RUN
–1
–1

ERROR:

none

Advertising