From bf8e099b9c8b3c60d60b3712b4fc97b052c39887 Mon Sep 17 00:00:00 2001 From: julieng Date: Tue, 3 Aug 2021 08:03:23 +0200 Subject: convert content to md --- .../reference/global_objects/math/atan2/index.md | 126 ++++++++------------- 1 file changed, 50 insertions(+), 76 deletions(-) (limited to 'files/fr/web/javascript/reference/global_objects/math/atan2') diff --git a/files/fr/web/javascript/reference/global_objects/math/atan2/index.md b/files/fr/web/javascript/reference/global_objects/math/atan2/index.md index 24923087e3..c95dd9050b 100644 --- a/files/fr/web/javascript/reference/global_objects/math/atan2/index.md +++ b/files/fr/web/javascript/reference/global_objects/math/atan2/index.md @@ -9,102 +9,76 @@ tags: translation_of: Web/JavaScript/Reference/Global_Objects/Math/atan2 original_slug: Web/JavaScript/Reference/Objets_globaux/Math/atan2 --- -
{{JSRef}}
+{{JSRef}} -

La fonction Math.atan2() renvoie l'arc tangente du quotient de ses arguments.

+La fonction **`Math.atan2()`** renvoie l'arc tangente du quotient de ses arguments. -
{{EmbedInteractiveExample("pages/js/math-atan2.html")}}
+{{EmbedInteractiveExample("pages/js/math-atan2.html")}} -

Syntaxe

+## Syntaxe -
Math.atan2(y, x) 
+ Math.atan2(y, x) -

Paramètres

+### Paramètres -
-
x
-
La coordonnée en abscisse du point.
-
y
-
La coordonnée en ordonnée du point.
-
+- `x` + - : La coordonnée en abscisse du point. +- `y` + - : La coordonnée en ordonnée du point. -

Valeur de retour

+### Valeur de retour -

L'arc tangente du quotient formé par les deux arguments, c'est-à-dire l'angle, exprimé en radians entre l'axe des abscisses et la droite passant par l'origin (0,0) et le point de coordonnées (x,y).

+L'arc tangente du quotient formé par les deux arguments, c'est-à-dire l'angle, exprimé en radians entre l'axe des abscisses et la droite passant par l'origin (0,0) et le point de coordonnées (x,y). -

Description

+## Description -

La méthode Math.atan2() renvoie une valeur numérique comprise entre -Pi et Pi qui représente l'angle theta d'un point de coordonnées (x,y). Cela correspond à l'angle (dans le sens trigonométrique) entre l'axe des abscisses et le point de coordonnées (x,y). Attention, le premier argument de la fonction est l'ordonnée (y) et le second est l'abscisse (x).

+La méthode `Math.atan2()` renvoie une valeur numérique comprise entre -Pi et Pi qui représente l'angle theta d'un point de coordonnées (x,y). Cela correspond à l'angle (dans le sens trigonométrique) entre l'axe des abscisses et le point de coordonnées (`x,y`). Attention, le premier argument de la fonction est l'ordonnée (y) et le second est l'abscisse (x). -

Graphique explicitant l'angle donné par un point de coordonnées X/Y

+![Graphique explicitant l'angle donné par un point de coordonnées X/Y](https://mdn.mozillademos.org/files/11565/atan2.png) -

Math.atan2() utilise deux arguments x et y, alors que la méthode Math.atan() utilise le ratio de deux nombres comme un seul argument.

+`Math.atan2()` utilise deux arguments `x` et `y`, alors que la méthode `Math.atan()` utilise le ratio de deux nombres comme un seul argument. -

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

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

Exemples

+## Exemples -

Utiliser Math.atan2()

+### Utiliser `Math.atan2()` -
Math.atan2(90, 15); // 1.4056476493802699
+```js
+Math.atan2(90, 15); // 1.4056476493802699
 Math.atan2(15, 90); // 0.16514867741462683
 
 Math.atan2( ±0, -0 );               // ±PI.
 Math.atan2( ±0, +0 );               // ±0.
-Math.atan2( ±0, -x );               // ±PI pour x > 0.
-Math.atan2( ±0, x );                // ±0 pour x > 0.
-Math.atan2( -y, ±0 );               // -PI/2 pour y > 0.
-Math.atan2( y, ±0 );                // PI/2 pour y > 0.
-Math.atan2( ±y, -Infinity );        // ±PI pour y qui est un nombre fini > 0.
-Math.atan2( ±y, +Infinity );        // ±0 pour y qui est un nombre fini > 0.
+Math.atan2( ±0, -x );               // ±PI pour x > 0.
+Math.atan2( ±0, x );                // ±0 pour x > 0.
+Math.atan2( -y, ±0 );               // -PI/2 pour y > 0.
+Math.atan2( y, ±0 );                // PI/2 pour y > 0.
+Math.atan2( ±y, -Infinity );        // ±PI pour y qui est un nombre fini > 0.
+Math.atan2( ±y, +Infinity );        // ±0 pour y qui est un nombre fini > 0.
 Math.atan2( ±Infinity, x );         // ±PI/2 pour x qui est un nombre fini.
 Math.atan2( ±Infinity, -Infinity ); // ±3*PI/4.
 Math.atan2( ±Infinity, +Infinity ); // ±PI/4.
-
- -

Spécifications

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpécificationÉtatCommentaires
{{SpecName('ES1')}}{{Spec2('ES1')}}Définition initiale. Implémentée avec JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.8.2.5', 'Math.atan2')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-math.atan2', 'Math.atan2')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-math.atan2', 'Math.atan2')}}{{Spec2('ESDraft')}} 
- -

Compatibilité des navigateurs

- -

{{Compat("javascript.builtins.Math.atan2")}}

- -

Voir aussi

- - +``` + +## Spécifications + +| Spécification | État | Commentaires | +| ---------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------------- | +| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Définition initiale. Implémentée avec JavaScript 1.0. | +| {{SpecName('ES5.1', '#sec-15.8.2.5', 'Math.atan2')}} | {{Spec2('ES5.1')}} |   | +| {{SpecName('ES6', '#sec-math.atan2', 'Math.atan2')}} | {{Spec2('ES6')}} |   | +| {{SpecName('ESDraft', '#sec-math.atan2', 'Math.atan2')}} | {{Spec2('ESDraft')}} |   | + +## Compatibilité des navigateurs + +{{Compat("javascript.builtins.Math.atan2")}} + +## Voir aussi + +- {{jsxref("Math.acos()")}} +- {{jsxref("Math.asin()")}} +- {{jsxref("Math.atan()")}} +- {{jsxref("Math.cos()")}} +- {{jsxref("Math.sin()")}} +- {{jsxref("Math.tan()")}} -- cgit v1.2.3-54-g00ecf