Math.atan()

La fonction Math.atan() renvoie l'arc tangente d'un nombre exprimée en radians. Elle est définie par :

Math.atan ( x ) = arctan ( x ) =le seul y [ - π 2 ; π 2 ] tel que tan ( y ) = x \mathtt{\operatorname{Math.atan}(x)} = \arctan(x) = \text{ the unique } ; y \in \left[-\frac{\pi}{2}; \frac{\pi}{2}\right] , \text{such that} ; \tan(y) = x

Exemple interactif

Syntaxe

js
Math.atan(x);

Paramètres

x

Un nombre.

Valeur de retour

L'arc tangente du nombre passé en argument (exprimé en radians).

Description

La méthode Math.atan() renvoie une valeur numérique comprise entre - π 2 -\frac{\pi}{2} et π 2 \frac{\pi}{2} .

atan() est une méthode statique de Math et doit toujours être utilisée avec la syntaxe Math.atan(), elle ne doit pas être utilisée comme une méthode d'un autre objet qui aurait été créé (Math n'est pas un constructeur).

Exemples

Utiliser Math.atan()

js
Math.atan(1); // 0.7853981633974483
Math.atan(0); // 0
Math.atan(-0); // -0

Math.atan(Infinity); // 1.5707963267948966
Math.atan(-Infinity); // -1.5707963267948966

// L'angle formé entre la droite [(0,0);(x,y)] et l'axe des abscisses
// dans un système de coordonnées cartésienne
Math.atan(y / x);

Spécifications

Specification
ECMAScript Language Specification
# sec-math.atan

Compatibilité des navigateurs

BCD tables only load in the browser

Voir aussi