diff options
| author | julieng <julien.gattelier@gmail.com> | 2021-08-03 08:03:23 +0200 |
|---|---|---|
| committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-09-03 08:08:25 +0200 |
| commit | bf8e099b9c8b3c60d60b3712b4fc97b052c39887 (patch) | |
| tree | c101746d082c9581c94f5937519c7d0e2f4af8cb /files/fr/web/javascript/reference/global_objects/math/atan2 | |
| parent | 844f5103992238c0c23203286dad16a466e89c97 (diff) | |
| download | translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.tar.gz translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.tar.bz2 translated-content-bf8e099b9c8b3c60d60b3712b4fc97b052c39887.zip | |
convert content to md
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/math/atan2')
| -rw-r--r-- | files/fr/web/javascript/reference/global_objects/math/atan2/index.md | 126 |
1 files changed, 50 insertions, 76 deletions
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 --- -<div>{{JSRef}}</div> +{{JSRef}} -<p>La fonction <code><strong>Math.atan2()</strong></code> renvoie l'arc tangente du quotient de ses arguments.</p> +La fonction **`Math.atan2()`** renvoie l'arc tangente du quotient de ses arguments. -<div>{{EmbedInteractiveExample("pages/js/math-atan2.html")}}</div> +{{EmbedInteractiveExample("pages/js/math-atan2.html")}} -<h2 id="Syntaxe">Syntaxe</h2> +## Syntaxe -<pre class="syntaxbox">Math.atan2(<var>y</var>, <var>x</var>) </pre> + Math.atan2(y, x) -<h3 id="Paramètres">Paramètres</h3> +### Paramètres -<dl> - <dt><code>x</code></dt> - <dd>La coordonnée en abscisse du point.</dd> - <dt><code>y</code></dt> - <dd>La coordonnée en ordonnée du point.</dd> -</dl> +- `x` + - : La coordonnée en abscisse du point. +- `y` + - : La coordonnée en ordonnée du point. -<h3 id="Valeur_de_retour">Valeur de retour</h3> +### Valeur de retour -<p>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).</p> +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). -<h2 id="Description">Description</h2> +## Description -<p>La méthode <code>Math.atan2()</code> 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 (<code>x,y</code>). Attention, le premier argument de la fonction est l'ordonnée (y) et le second est l'abscisse (x).</p> +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). -<p><img alt="Graphique explicitant l'angle donné par un point de coordonnées X/Y" src="https://mdn.mozillademos.org/files/11565/atan2.png"></p> + -<p><code>Math.atan2()</code> utilise deux arguments <code>x</code> et <code>y</code>, alors que la méthode <code>Math.atan()</code> utilise le ratio de deux nombres comme un seul argument.</p> +`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. -<p><code>atan2()</code> est une méthode statique de l'objet <code>Math</code>, elle doit toujours être utilisée avec la syntaxe <code>Math.atan2()</code>, elle ne doit pas être utilisée comme la méthode d'un autre objet qui aurait été créé (<code>Math</code> n'est pas un constructeur).</p> +`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). -<h2 id="Exemples">Exemples</h2> +## Exemples -<h3 id="Utiliser_Math.atan2()">Utiliser <code>Math.atan2()</code></h3> +### Utiliser `Math.atan2()` -<pre class="brush:js">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. -</pre> - -<h2 id="Spécifications">Spécifications</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Spécification</th> - <th scope="col">État</th> - <th scope="col">Commentaires</th> - </tr> - <tr> - <td>{{SpecName('ES1')}}</td> - <td>{{Spec2('ES1')}}</td> - <td>Définition initiale. Implémentée avec JavaScript 1.0.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.8.2.5', 'Math.atan2')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-math.atan2', 'Math.atan2')}}</td> - <td>{{Spec2('ES6')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-math.atan2', 'Math.atan2')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - -<p>{{Compat("javascript.builtins.Math.atan2")}}</p> - -<h2 id="Voir_aussi">Voir aussi</h2> - -<ul> - <li>{{jsxref("Math.acos()")}}</li> - <li>{{jsxref("Math.asin()")}}</li> - <li>{{jsxref("Math.atan()")}}</li> - <li>{{jsxref("Math.cos()")}}</li> - <li>{{jsxref("Math.sin()")}}</li> - <li>{{jsxref("Math.tan()")}}</li> -</ul> +``` + +## 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()")}} |
