Es6-math-atan-2

提供:Dev Guides
2020年6月23日 (火) 08:04時点におけるMaintenance script (トーク | 投稿記録)による版 (Imported from text file)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

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