sine function
The sin
function is a trigonometric function. The sin
function returns the sine of an angle specified in radians.
Syntax:
double sin(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 zero if n resolves to a positive/negative zero.
- Returns a NULL value in the following cases:
Example 12-91 sine function
SELECT sin(n) FROM Archery
Value of n | Output |
---|---|
radians(90) | 1.0 |
pi()/4 | 0.7071067811865475 |
3*pi()/2 | -1.0 |