ES6 - Math.tan(x) 函式



此函式返回 x 的正切值。

語法

Math.tan(x)      

引數

  • 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        
廣告
© . All rights reserved.