COS Function

COS(a)

Returns the cosine of a.

Parameters

a(REAL)

The input value in radians.

Return Value

Returns a REAL.

Remarks

Notice a is in radians. To convert a value from degrees to radians, multiply the degrees value by π/180. The RMC has an M_PI constant for π.

Due to the 32-bit floating point limitations, COS(M_PI / 2) returns -43.71139E-9 instead of zero. For complex calculations, you may need to check for an exact zero and code the return value as needed.

Examples

COS(M_PI) returns -1.0

COS(45 * M_PI / 180) returns 0.70710677

 

See Also

SIN Function | TAN Function | ACOS Function | Standard Functions


Send comments on this topic.

Copyright © 2024 Delta Computer Systems, Inc. dba Delta Motion