MySQL ACOS() Function
In MySQL, the ACOS()
function returns the arc cosine of the specified number.
ACOS()
Syntax
Here is the syntax of MySQL ACOS()
function:
ACOS(number)
Parameters
number
- Required. The value whose arc cosine is to be returned.
Return value
In MySQL, the ACOS()
function returns the arc cosine of the specified number.
- If the argument
number
is not between-1
and1
, theACOS()
function will returnNULL
. - If the argument
number
isNULL
, theACOS()
function will returnNULL
.
ACOS()
Examples
SELECT
ACOS(0.5),
ACOS(0.2),
ACOS(-0.5),
ACOS(-0.2),
ACOS(1),
ACOS(0),
ACOS(-1),
ACOS(2),
ACOS(-2),
ACOS(NULL)\G
output
*************************** 1\. row ***************************
ACOS(0.5): 1.0471975511965979
ACOS(0.2): 1.369438406004566
ACOS(-0.5): 2.0943951023931957
ACOS(-0.2): 1.7721542475852274
ACOS(1): 0
ACOS(0): 1.5707963267948966
ACOS(-1): 3.141592653589793
ACOS(2): NULL
ACOS(-2): NULL
ACOS(NULL): NULL