English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript Math.cos() Method

 JavaScript Math Object

Math.cos()method returns the cosine value of the specified number.

The Math.cos() method returns a value between-1and1between the numerical values, which represent the cosine of the angle.

Since cos() is a static method of Math, you always use it asMath.cos(), rather than as a method of the created Math object.

Syntax:

Math.cos(x)
Math.cos(1);
Test See‹/›

Browser Compatibility

All browsers fully support the Math.cos() method:

Method
Math.cos()YesYesYesYesYes

Parameter Value

ParameterDescription
xValue

Technical Details

Return Value:Cosine of a Given Number
JavaScript Version:ECMAScript 1

 JavaScript Math Object