
Commands - 25
COS
Numeric Fun ction
SYNTAX: n = COS(m)
PURPOSE: To return the trigonometric 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.
Trigonometr ic functions ar e computed as a power ser ies in CA MBASIC. 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: 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
Comentários a estes Manuais