Die Math.sinh()
Funktion gibt den Sinus Hyperbolicus einer Zahl zurück. Dieser kann mit dem Einsatz der Eulerschen Zahl folgendermaßen berechnet werden:
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Syntax
Math.sinh(x)
Parameter
x
- Eine Zahl.
Rückgabewert
Den Sinus Hyperbolicus der übergebenen Zahl.
Beschreibung
Weil sinh()
eine statische Funktion von Math
ist, wird es immer als Math.sinh()
eingesetzt,
jedoch nicht als Methode eines erzeugten Math
Objektes (Math
ist kein Konstruktor).
Beispiele
Einsatz von Math.sinh()
Math.sinh(0); // 0
Math.sinh(1); // 1.1752011936438014
Polyfill
Diese Funktion kann mit Hilfe der Funktion Math.exp()
emuliert werden:
Math.sinh = Math.sinh || function(x) {
return (Math.exp(x) - Math.exp(-x)) / 2;
}
Oder nur mit einem Aufruf der Math.exp()
Funktion:
Math.sinh = Math.sinh || function(x) {
var y = Math.exp(x);
return (y - 1 / y) / 2;
}
Spezifikationen
Spezifikation | Status | Kommentar |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) Die Definition von 'Math.sinh' in dieser Spezifikation. |
Standard | Initiale Definition. |
ECMAScript (ECMA-262) Die Definition von 'Math.sinh' in dieser Spezifikation. |
Lebender Standard |
Browserkompatibilität
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.