Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. JavaScript
  3. Reference
  4. Standard built-in objects
  5. Math
  6. sin()

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.

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-15

Syntax

js
Math.sin(x)

Parameters

x

A 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); // NaN

Specifications

Specification
ECMAScript® 2026 Language Specification
# sec-math.sin

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp