Math.tan()
함수는 탄젠트 값을 반환합니다
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
신텍스
Math.tan(x)
Parameters
x
- 라디안 각도
반환 값
주어진 수의 탄젠트 값
설명
Math.tan()
메소드는 각도의 탄젠트 값을 수로 반환합니다.
tan()
은 Math
의 정적 메서드이므로 사용자가 만든 Math
객체의 메서드가 아닌 항상 Math.tan()
으로 사용합니다 (Math
는 생성자가 아닙니다).
예
Using Math.tan()
Math.tan(1); // 1.5574077246549023
Math.tan()
함수는 라디안 값으로 받지만 각도로 작업하는 것이 더 쉽기 때문에 다음 함수는 각도로 값을 받아서 라디안으로 변환하고 탄젠트를 반환합니다.
function getTanDeg(deg) {
var rad = deg * Math.PI/180;
return Math.tan(rad);
}
Specifications
Specification | Status | Comment |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Standard | Initial definition. Implemented in JavaScript 1.0. |
ECMAScript 5.1 (ECMA-262) The definition of 'Math.tan' in that specification. |
Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Math.tan' in that specification. |
Standard | |
ECMAScript (ECMA-262) The definition of 'Math.tan' in that specification. |
Living Standard |
브라우저 호환성
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.