Function Reference > Functions > COS
  

COS

Returns the cosine of a numeric value (expressed in radians).

Syntax

COS( numeric_value )
Argument
Required/
Optional
Description
numeric_value
Required
Numeric datatype. Numeric data expressed in radians (degrees multiplied by pi divided by 180). Passes the values for which you want to calculate a cosine. You can enter any valid expression.

Return Value

Double value.
NULL if a value passed to the function is NULL.

Example

The following expression returns the cosine for all values in the DEGREES column:
COS( DEGREES * 3.14159265359 / 180 )
DEGREES   
RETURN VALUE
0
1.0
90
0.0
70
0.342020143325593
30
0.866025403784421
5
0.996194698091745
18
0.951056516295147
89
0.0174524064371813
NULL
NULL

Tip

You can perform arithmetic on the values passed to COS before the function calculates the cosine. For example, you can convert the values in the column to radians before calculating the cosine, as follows:
COS( ARCS * 3.14159265359 / 180 )