Skip to content

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): number

Parameters ​

  • 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 angle
  • asin - Calculates the arcsine
  • atan - Calculates the arctangent

Sources ​

Released under the MIT license.