ES6 - Fonction Math.atan2 ()

Cette méthode renvoie l'arc tangente du quotient de ses arguments. La méthode atan2 renvoie une valeur numérique comprise entre -pi et pi représentant l'angle thêta d'un point (x, y).

Syntaxe

Math.atan2(x,y)

Paramètre

  • x et y - représente un nombre

Exemple

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

Production

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