Skip to content

COS

Cosine

This numeric function returns the cosine of an angle expressed in radians.

COS (numeric-value [,ERR=line-ref|,ERC=error-code])
numeric-value
is a number from 0 to 3.14 radians.
line-ref
is the program line number or label to branch to if an error is produced by this function.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.

This function returns a number in the range of +1.0 to -1.0 for numeric-values ranging from 0 to 3.14 (Pi) radians (0 to 180 degrees).

Note that COS and ACS are reverse functions; that is:

COS (ACS(x)) = x
ACS (COS(x)) = x
COS (0)

The result is 1.

COS (1.57)

The result is 0.

COS (3.14)

The result is -1.

These examples assume PRECISION 2.

ACS function

From the Thoroughbred Basic Language Reference, Volume I: A–E, version 8.9.1. Open this page in the PDF