English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
Math.cos(x)
Math.cos(1);Test See‹/›
All browsers fully support the Math.cos() method:
Method | |||||
Math.cos() | Yes | Yes | Yes | Yes | Yes |
Parameter | Description |
---|---|
x | Value |
Return Value: | Cosine of a Given Number |
---|---|
JavaScript Version: | ECMAScript 1 |