English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Math.sin()The method returns the sine value of a number.
The Math.sin() method returns a sine value between-1and1between the numerical values, which represent the sine of the angle in radians.
Because sin() is a static method of Math, you should always use it asMath.sin(), rather than used as methods of the created Math object.
Math.sin(x)
Math.sin(0); // 0 Math.sin(1); // 0.8414709848078965 Math.sin(4); // -0.7568024953079282 Math.sin(Math.PI); // 1.2246467991473532e-16 Math.sin(Math.PI / 2); // 1Test See‹/›
All browsers fully support the Math.sin() method:
Method | |||||
Math.sin() | Yes | Yes | Yes | Yes | Yes |
Parameter | Description |
---|---|
x | Number |
Return Value: | Sine of a Given Number |
---|---|
JavaScript Version: | ECMAScript 1 |