无涯教程-Math.tan(x)函数

49 阅读1分钟

此函数返回x的正切。

Math.tan(x) - 语法

Math.tan(x)      
  • x   -  代表一个数字

Math.tan(x) - 示例

console.log("---Math.tan()---") 
console.log("Math.tan(Math.PI/4): "+Math.tan(Math.PI/4)) 
console.log("Math.tan(0): "+Math.tan(0))           

运行上面代码输出

---Math.tan()--- 
Math.tan(Math.PI/4): 0.9999999999999999 
Math.tan(0): 0        

参考链接

www.learnfk.com/es6/es6-mat…