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: