Math.tan()
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.tan()
ํจ์๋ ํ์ ํธ ๊ฐ์ ๋ฐํํฉ๋๋ค
์๋ํด ๋ณด๊ธฐ
function getTanFromDegrees(degrees) {
return Math.tan((degrees * Math.PI) / 180);
}
console.log(getTanFromDegrees(0));
// Expected output: 0
console.log(getTanFromDegrees(45));
// Expected output: 0.9999999999999999
console.log(getTanFromDegrees(90));
// Expected output: 16331239353195370
๋ฌธ๋ฒ
Math.tan(x);
๋งค๊ฐ๋ณ์
x
-
๋ผ๋์ ๊ฐ๋๋ฅผ ํํํ ์.
๋ฐํ ๊ฐ
์ฃผ์ด์ง ์์ ํ์ ํธ ๊ฐ
์ค๋ช
Math.tan()
๋ฉ์๋๋ ๊ฐ๋์ ํ์ ํธ ๊ฐ์ ํํํ๋ ์๋ฅผ ๋ฐํํฉ๋๋ค.
tan()
์ Math
์ ์ ์ ๋ฉ์๋์ด๋ฏ๋ก ์ฌ์ฉ์๊ฐ ๋ง๋ Math
๊ฐ์ฒด์ ๋ฉ์๋๊ฐ ์๋ ํญ์ Math.tan()
์ผ๋ก ์ฌ์ฉํฉ๋๋ค (Math
๋ ์์ฑ์๊ฐ ์๋๋๋ค).
์์
Math.tan()
์ฌ์ฉํ๊ธฐ
Math.tan(1); // 1.5574077246549023
Math.tan()
ํจ์๋ ๋ผ๋์ ๊ฐ์ผ๋ก ๋ฐ์ง๋ง ๊ฐ๋๋ก ์์
ํ๋ ๊ฒ์ด ๋ ์ฝ๊ธฐ ๋๋ฌธ์ ๋ค์ ํจ์๋ ๊ฐ๋๋ก ๊ฐ์ ๋ฐ์์ ๋ผ๋์์ผ๋ก ๋ณํํ๊ณ ํ์ ํธ๋ฅผ ๋ฐํํฉ๋๋ค.
function getTanDeg(deg) {
var rad = (deg * Math.PI) / 180;
return Math.tan(rad);
}
๋ช ์ธ
Specification |
---|
ECMAScriptยฎ 2026 Language Specification # sec-math.tan |
๋ธ๋ผ์ฐ์ ํธํ์ฑ
Loadingโฆ