From 39f2114f9797eb51994966c6bb8ff1814c9a4da8 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 12:36:08 +0100 Subject: unslug fr: move --- .../reference/global_objects/math/atanh/index.html | 102 +++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 files/fr/web/javascript/reference/global_objects/math/atanh/index.html (limited to 'files/fr/web/javascript/reference/global_objects/math/atanh') diff --git a/files/fr/web/javascript/reference/global_objects/math/atanh/index.html b/files/fr/web/javascript/reference/global_objects/math/atanh/index.html new file mode 100644 index 0000000000..ef350947af --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/math/atanh/index.html @@ -0,0 +1,102 @@ +--- +title: Math.atanh() +slug: Web/JavaScript/Reference/Objets_globaux/Math/atanh +tags: + - JavaScript + - Math + - Méthode + - Reference + - polyfill +translation_of: Web/JavaScript/Reference/Global_Objects/Math/atanh +--- +
{{JSRef}}
+ +

La fonction Math.atanh() renvoie l'arc tangente hyperbolique d'un nombre :

+ +

x(-1,1),Math.atanh(x)=arctanh(x)= le seul y  tel quetanh(y)=x\forall x \in \left( -1, 1 \right), \mathtt{\operatorname{Math.atanh}(x)} = \operatorname{arctanh}(x) = \text{ the unique } \; y \; \text{such that} \; \tanh(y) = x

+ +
{{EmbedInteractiveExample("pages/js/math-atanh.html")}}
+ + + +

Syntaxe

+ +
Math.atanh(x)
+ +

Paramètres

+ +
+
x
+
Un nombre.
+
+ +

Valeur de retour

+ +

L'arc tangente hyperbolique du nombre passé en argument.

+ +

Description

+ +

atanh() est une méthode statique de Math, il faut utiliser la syntaxe Math.atanh(), et non pas une méthode d'un objet Math créé sur mesure (Math n'est pas un constructeur).

+ +

Exemple

+ +

Utiliser Math.atanh()

+ +
Math.atanh(-2);  // NaN
+Math.atanh(-1);  // -Infinity
+Math.atanh(0);   // 0
+Math.atanh(0.5); // 0.5493061443340548
+Math.atanh(1);   // Infinity
+Math.atanh(2);   // NaN
+
+ +

Pour les valeurs strictement inférieures à -1 ou strictement supérieures à 1, {{jsxref("NaN")}} sera renvoyé.

+ +

Prothèse d'émulation (polyfill)

+ +

Pour |x|<1\left|x\right| < 1, on a la formule suivante : artanh(x)=12ln(1+x1-x)\operatorname {artanh} (x) = \frac{1}{2}\ln \left( \frac{1 + x}{1 - x} \right)et on peut donc émuler la fonction avec :

+ +
Math.atanh = Math.atanh || function(x) {
+  return Math.log((1+x)/(1-x)) / 2;
+};
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + +
SpécificationStatutCommentaires
{{SpecName('ES6', '#sec-math.atanh', 'Math.atanh')}}{{Spec2('ES6')}}Définition initiale.
{{SpecName('ESDraft', '#sec-math.atanh', 'Math.atanh')}}{{Spec2('ESDraft')}} 
+ +

Compatibilité des navigateurs

+ + + +

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

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf