---
title: Math.acosh()
slug: Web/JavaScript/Reference/Global_Objects/Math/acosh
tags:
- JavaScript
- Math
- Méthode
- Reference
- polyfill
translation_of: Web/JavaScript/Reference/Global_Objects/Math/acosh
original_slug: Web/JavaScript/Reference/Objets_globaux/Math/acosh
---
{{JSRef}}
La fonction **`Math.acosh()`** renvoie l'arc cosinus hyperbolique d'un nombre.Elle est définie par :
{{EmbedInteractiveExample("pages/js/math-acosh.html")}}
## Syntaxe
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 {{jsxref("NaN")}}.
## Description
`acos`h é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 {{jsxref("NaN")}}.
## Prothèse d'émulation (_polyfill_)
Pour tout , , 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
| Spécification | État | Commentaires |
| ---------------------------------------------------------------------------- | ---------------------------- | ------------------- |
| {{SpecName('ES6', '#sec-math.acosh', 'Math.acosh')}} | {{Spec2('ES6')}} | Définition initiale |
| {{SpecName('ESDraft', '#sec-math.acosh', 'Math.acosh')}} | {{Spec2('ESDraft')}} | |
## Compatibilité des navigateurs
{{Compat("javascript.builtins.Math.acosh")}}
## Voir aussi
- {{jsxref("Math.asinh()")}}
- {{jsxref("Math.atanh()")}}
- {{jsxref("Math.cosh()")}}
- {{jsxref("Math.sinh()")}}
- {{jsxref("Math.tanh()")}}