JavaScript Math sin() Method

Math.sin(x) expect x in radians

Definition and Usage

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.

What is Radians?

Radians is an angle's α amount of rotation b on a circle:
DegreesPIRadians
00
PI/1800.0175
30°PI/60.52
45°PI/40.79
90°PI/21.57
180°PI3.14
360°PI*26.28

Syntax

Math.sin(x)

Parameters

Parameter Description
x Required.
A number representing radians.

Return Value

Type Description
Number -1 to 1. The sine of the number.
NaN if the parameter is not numeric.

The Pythagoran Therorem

Math.sin(), Math.cos(), and Math.tan() are related to the Pythagorean theorem:
Theorem: c2 = a2 = b2

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.

Browser Support

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