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 โจ2015๋ 7์โฉ.
Math.sin()
ํจ์๋ ์ซ์์ ์ฌ์ธ๊ฐ์ ๋ฐํํฉ๋๋ค.
์๋ํด ๋ณด๊ธฐ
function getCircleY(radians, radius) {
return Math.sin(radians) * radius;
}
console.log(getCircleY(1, 10));
// Expected output: 8.414709848078965
console.log(getCircleY(2, 10));
// Expected output: 9.092974268256818
console.log(getCircleY(Math.PI, 10));
// Expected output: 1.2246467991473533e-15
Syntax
js
Math.sin(x);
ํ๋ผ๋ฏธํฐ
x
-
์ซ์ (๋ผ๋์์ผ๋ก ์ฃผ์ด์ง).
๋ฐํ ๊ฐ
์ฃผ์ด์ง ์ซ์์ ์ฌ์ธ ๊ฐ
์ค๋ช
Math.sin()
๋ฉ์๋๋ ๋ผ๋์์ผ๋ก ์ฃผ์ด์ง ๊ฐ๋์ ์ฌ์ธ ๊ฐ์ธ -1๊ณผ 1 ์ฌ์ด์ ์๋ฅผ ๋ฐํํฉ๋๋ค.
sin()
์ Math
์ ์คํํฑ ๋ฉ์๋์ด๊ธฐ ๋๋ฌธ์, Math
์ค๋ธ์ ํธ ์ ๋ฉ์๋๋ก ์ฌ์ฉํ์ง ๋ง๊ณ ํญ์ Math.sin()
๋ก ์ฌ์ฉํด์ผํฉ๋๋ค. (Math
๋ ์์ฑ์๊ฐ ์๋๋๋ค).
์
Using Math.sin()
js
Math.sin(0); // 0
Math.sin(1); // 0.8414709848078965
Math.sin(Math.PI / 2); // 1
๋ช ์ธ์
Specification |
---|
ECMAScriptยฎ 2026 Language Specification # sec-math.sin |
๋ธ๋ผ์ฐ์ ํธํ์ฑ
Loadingโฆ