arc cosine function
The acos
function is an inverse trigonometric function. The acos
function returns the arc cosine (inverse of cosine) of the input expression.
Syntax:
double acos(n)
Semantics:
- n: The argument n is an expression that resolves to a number.
- return type: double.
The resultant angle is expressed in radians and is in the range 0.0 through
pi
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 in the following cases:
- n resolves to NaN
- absolute value of n is greater than one
- n resolves to positive/negative infinity
- Returns a NULL value in the following cases:
Example 12-71 arc cosine function
SELECT acos(n) FROM Archery
Value of n | Output |
---|---|
1 | 0.0 |
0 | 1.5707963267948966 |
sqrt(3)/2 | 0.5235987755982989 |
0.5 | 1.0471975511965979 |
-1 | 3.141592653589793 |