cosine function
The cos
function is a trigonometric function. The cos
function returns the cosine of an angle specified in radians.
Syntax:
double cos(n)
Semantics:
- n: The argument n is an expression that resolves to a number (an angle expressed in radians).
- return type: double.
The resultant value is in the range -1 through 1 with the following exceptions:
- Returns a NULL value in the following cases:
- n resolves to a NULL value
- n does not resolve to a number
- Returns NaN if n resolves to NaN or infinity(positive/negative).
- Returns a NULL value in the following cases:
Example:
SELECT cos(n) FROM Archery
Value of n | Output |
---|---|
0 | 1.0 |
radians(90) | 6.123233995736766E-17 |
pi() | -1.0 |