Es6-math-atan-2

提供:Dev Guides
移動先:案内検索

ES6-Math.atan2()関数

このメソッドは、引数の商のアークタンジェントを返します。 atan2メソッドは、(x、y)ポイントの角度シータを表す-piとpiの間の数値を返します。

構文

Math.atan2(x,y)

パラメータ

  • xおよびy −は数値を表します

console.log("---Math.atan2()---")
console.log("Math.atan2(0): "+Math.atan2(0,1))
console.log("Math.atan2(Math.SQRT1_2): "+Math.atan2(1,1))

出力

---Math.atan2()---
Math.atan2(0): 0
Math.atan2(Math.SQRT1_2): 0.7853981633974483