Caché MultiValue Basic Reference
COS

 Server:docs2 Instance:LATEST User:UnknownUser

 [ Home ]  >  [ MultiValue Features of Caché ]  >  [ Caché MultiValue Basic Reference ]  >  [ Caché MultiValue Basic Functions ]  >  [ COS ] Go to: Description Examples See Also Search:

Returns the cosine of an angle.
Synopsis
`COS(number)`
Arguments
 number An expression that resolves to a number that expresses an angle in degrees.
Description
The COS function takes an angle in degrees and returns the ratio of two sides of a right triangle. The ratio is the length of the side adjacent to the angle divided by the length of the hypotenuse. This ratio is in the range of 1 to -1 (inclusive).
Examples
The following example uses the COS function to return the cosine of an angle:
```Dim MyAngle
MyAngle = 1.3;         ! Define angle in degrees.
PRINT COS(MyAngle);    ! Returns cosine ratio.```
The following example uses the COS function to return the secant of an angle:
```Dim MyAngle, MySecant
MyAngle = 1.3;                ! Define angle in degrees.
MySecant = 1 / Cos(MyAngle);  ! Calculate secant.
Print MySecant;               ! Secant in radians.```