acos
The acos() method returns the arccosine of a number, that is, the angle (in radians) whose cosine is equal to the given value. It is the inverse function of cos().
Interactive example
Syntax
typescript
function acos<
GenericInput extends number,
>(input: GenericInput): numberParameters
input: A number between -1 and 1 representing the cosine of an angle.
Return value
The angle in radians (between 0 and π) whose cosine equals the given value. Returns NaN if the value is outside the interval [-1, 1].
See also
cos- Calculates the cosine of an angleasin- Calculates the arcsineatan- Calculates the arctangent
