Skip to content

cos

The cos() method returns the cosine of an angle expressed in radians. Cosine is a fundamental trigonometric function that returns the x-coordinate of a point on the unit circle.

Interactive example

Syntax

typescript
function cos<
	GenericInput extends number,
>(input: GenericInput): number

Parameters

  • input: The angle in radians for which to calculate the cosine.

Return value

The cosine of the given angle, a value between -1 and 1.

See also

  • sin - Calculates the sine of an angle
  • tan - Calculates the tangent of an angle
  • acos - Calculates the arccosine

Sources

Released under the MIT license.