In javascript, The acos method is used to calculate the arccosine of a value. This function needs to input a value between-1.0 and 1.0. If the input parameter is not in this range, NaN, this article describes how to use the acos function through examples. For more information about the coders, see. The arccosine of the number returned by the acos method.
Basic syntax
Math.acos(number)
Parameter Introduction
The required number parameter is a numeric expression for calculating the arccosine value. It must be the number from-1.0 to 1.0. If the number Parameter exceeds this range, NaN is returned.
Return Value
The return value is the inverse cosine of the number parameter.
Note the following two points:
- If the number Parameter exceeds the range from-1.0 to 1.0, NaN is returned.
- If the value of the parameter number is-1, the PI is returned.
- If the parameter is not a value, NAN is returned.
Instance: