--- title: Math.sinh() slug: Web/JavaScript/Reference/Global_Objects/Math/sinh tags: - ECMAScript 2015 - JavaScript - Math - Méthode - Reference - polyfill translation_of: Web/JavaScript/Reference/Global_Objects/Math/sinh original_slug: Web/JavaScript/Reference/Objets_globaux/Math/sinh ---
La fonction Math.sinh() renvoie le sinus hyperbolique d'un nombre, dont la formule, utilisant la constante {{jsxref("Math.E","e")}}, est :
Math.sinh(x)
xLe sinus hyperbolique de la valeur passée en argument.
sinh() est une méthode statique de Math, il faut utiliser la syntaxe Math.. Cette méthode ne doit pas être appelée depuis un autre objet qui aurait été créé (sinh()Math n'est pas un constructeur).
Math.sinh(0) // 0 Math.sinh(1) // 1.1752011936438014
Si cette fonction n'est pas disponible, elle peut être émulée en utilisant la fonction {{jsxref("Math.exp()")}} :
Math.sinh = Math.sinh || function(x){
return (Math.exp(x) - Math.exp(-x)) / 2;
};
ou encore, si on n'utilise qu'une fois {{jsxref("Math.exp()")}}, avec :
Math.sinh = Math.sinh || function(x){
var y = Math.exp(x);
return (y - 1/y) / 2;
};
| Spécification | État | Commentaires |
|---|---|---|
| {{SpecName('ES2015', '#sec-math.sinh', 'Math.sinh')}} | {{Spec2('ES2015')}} | Définition initiale |
| {{SpecName('ESDraft', '#sec-math.sinh', 'Math.sinh')}} | {{Spec2('ESDraft')}} |
{{Compat("javascript.builtins.Math.sinh")}}