Math.sin()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
TheMath.sin() static method returns the sine of a number in radians.
In this article
Try it
function getCircleY(radians, radius) { return Math.sin(radians) * radius;}console.log(getCircleY(1, 10));// Expected output: 8.414709848078965console.log(getCircleY(2, 10));// Expected output: 9.092974268256818console.log(getCircleY(Math.PI, 10));// Expected output: 1.2246467991473533e-15Syntax
js
Math.sin(x)Parameters
xA number representing an angle in radians.
Return value
The sine ofx, between -1 and 1, inclusive. Ifx isInfinity,-Infinity, orNaN, returnsNaN.
Description
Becausesin() is a static method ofMath, you always use it asMath.sin(), rather than as a method of aMath object you created (Math is not a constructor).
Examples
>Using Math.sin()
js
Math.sin(-Infinity); // NaNMath.sin(-0); // -0Math.sin(0); // 0Math.sin(1); // 0.8414709848078965Math.sin(Math.PI / 2); // 1Math.sin(Infinity); // NaNSpecifications
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-math.sin> |