offline version v3


43 of 264 menu

Math.cos method

The Math.cos method returns the cosine of a number (this number must be an angle in radians).

Syntax

Math.cos(number);

Example

Let's output the cosine of the number 34:

console.log(Math.cos(34));

The code execution result:

-0.8485702747846052

See also

  • the Math.sin method
    that returns the sine of a number
  • the Math.tan method
    that returns the tangent of a number
  • the Math.asin method
    that returns the arcsine of a number
  • the Math.acos method
    that returns the arccosine of a number
  • the Math.atan method
    that returns the arctangent of a number
enru