What is ACOS() in SQL?
The ACOS() functionarc cosine function
Figure 1 shows the mathematical representation of the ACOS() function and Figure 2 shows the visual representation of the ACOS() function.
Syntax
ACOS(number)
Parameter
This function requires a number as a parameter. The parameter must be a float value between -1 and 1, i.e., -1 <= parameter <= 1.
Return Value
ACOS() returns the inverse cosine of a number (radian float value) that is sent as a parameter. If the parameter is not between -1 and 1, it returns NULL.
Example
/*example showing how to use ACOS(X)*/-- positive numberselect ACOS(1);-- negative numberselect ACOS(-1);-- fractional numberselect ACOS(0.6);-- not between -1 and 1select ACOS(3);select ACOS(-3);