[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh [Back]  [Original]

Math : mthode statique atanh() - JavaScript | MDN

Cette page a t traduite partir de l'anglais par la communaut. Vous pouvez contribuer en rejoignant la communaut francophone sur MDN Web Docs.

View in English Always switch to English

Math : mthode statique atanh()

Baseline Large disponibilit

Cette fonctionnalit est bien tablie et fonctionne sur de nombreux appareils et versions de navigateurs. Elle est disponible sur tous les navigateurs depuis juillet 2015.

La mthode statique Math.atanh() retourne l'arc tangente hyperbolique d'un nombre. C'est--dire,

x(1,1),.()=artanh(x)=l'unique y telle que tanh(y)=x=12ln(1+x1-x)\begin{aligned}\forall x \in ({-1}, 1),\;\mathtt{\operatorname{Math.atanh}(x)} &= \operatorname{artanh}(x) = \text{l'unique } y \text{ telle que } \tanh(y) = x \\&= \frac{1}{2}\,\ln\left(\frac{1+x}{1-x}\right)\end{aligned}

Dans cet article

Exemple interactif

console.log(Math.atanh(-1));
// Sortie attendue : -Infinity

console.log(Math.atanh(0));
// Sortie attendue : 0

console.log(Math.atanh(0.5));
// Sortie attendue : 0.549306144334055 (approximativement)

console.log(Math.atanh(1));
// Sortie attendue : Infinity

Syntaxe

js
Math.atanh(x)

Paramtres

x

Un nombre compris entre -1 et 1, inclus.

Valeur de retour

La tangente hyperbolique inverse de x. Si x est 1, retourne Infinity. Si x est -1, retourne -Infinity. Si x est infrieur -1 ou suprieur 1, retourne NaN.

Description

Parce que atanh() est une mthode statique de Math, vous l'utilisez toujours comme Math.atanh(), et non comme mthode d'un objet Math que vous auriez cr (Math n'est pas un constructeur).

Exemple

Utiliser la mthode Math.atanh()

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

Spcifications

Spcification
ECMAScript 2027 LanguageSpecification
# sec-math.atanh

Compatibilit des navigateurs

Voir aussi


Web Proxy Viewer  |  New URL  |  Original Page