Math.acosh()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

La fonction Math.acosh() renvoie l'arc cosinus hyperbolique d'un nombre.Elle est définie par :

x1,Math.acosh(x)=arcosh(x)= l'unique y0tel quecosh(y)=x\forall x \geq 1, \mathtt{\operatorname{Math.acosh}(x)} = \operatorname{arcosh}(x) = \text{ the unique } ; y \geq 0 ; \text{such that} ; \cosh(y) = x

Exemple interactif

Syntaxe

js
Math.acosh(x);

Paramètres

x

Un nombre.

Valeur de retour

L'arc cosinus hyperbolique du nombre en argument. Si le nombre est inférieur à 1, la valeur renvoyée sera NaN.

Description

acosh étant une méthode statique de Math, il faut l'utiliser avec Math.acosh(), plutôt qu'en faisant appel à une méthode d'un autre objet créé (Math n'est pas un constructeur).

Exemple

Utiliser Math.acosh()

js
Math.acosh(-1); // NaN
Math.acosh(0); // NaN
Math.acosh(0.5); // NaN
Math.acosh(1); // 0
Math.acosh(2); // 1.3169578969248166

Pour les valeurs strictement inférieures à 1 Math.acosh renvoie NaN.

Prothèse d'émulation (polyfill)

Pour tout x1x \geq 1, arcosh(x)=ln(x+x2-1)\operatorname {arcosh} (x) = \ln \left(x + \sqrt{x^{2} - 1} \right), on peut donc émuler cette fonction avec le code suivant :

js
function acosh(x) {
  return Math.log(x + Math.sqrt(x * x - 1));
}

Spécifications

Specification
ECMAScript® 2025 Language Specification
# sec-math.acosh

Compatibilité des navigateurs

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
acosh

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Voir aussi