HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Math.sin(x) expect x in radians
The Math.sin()
method returns the sine of a number.
The Math.sin()
method returns a number between -1 and 1.
The Math.sin()
method expects the number in radians.
Degrees | PI | Radians |
---|---|---|
0° | 0 | 0 |
1° | PI/180 | 0.0175 |
30° | PI/6 | 0.52 |
45° | PI/4 | 0.79 |
90° | PI/2 | 1.57 |
180° | PI | 3.14 |
360° | PI*2 | 6.28 |
Parameter | Description |
x | Required. A number representing radians. |
Type | Description |
Number | -1 to 1. The sine of the number.NaN if the parameter is not numeric. |
Math.sin()
, Math.cos()
,
and Math.tan()
are related to the Pythagorean theorem:
The sine Math.sin()
to the angle is a / c.
The cosine Math.cos()
to the angle is b / c.
The tangent Math.tan()
to the angle is a / b.
Math.sin()
is an ECMAScript1 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |