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.

Die Math.acosh() statische Methode gibt den inversen hyperbolischen Kosinus einer Zahl zurück. Das bedeutet,

x1,𝙼𝚊𝚝𝚑.𝚊𝚌𝚘𝚜𝚑(𝚡)=arcosh(x)=die eindeutige y0 so dass cosh(y)=x=ln(x+x21)\begin{aligned}\forall x \geq 1,\;\mathtt{\operatorname{Math.acosh}(x)}} &= \operatorname{arcosh}(x) = \text{die eindeutige } y \geq 0 \text{ so dass } \cosh(y) = x\\&= \ln\left(x + \sqrt{x^2 - 1}\right)\end{aligned}

Probieren Sie es aus

console.log(Math.acosh(0.999999999999));
// Expected output: NaN

console.log(Math.acosh(1));
// Expected output: 0

console.log(Math.acosh(2));
// Expected output: 1.3169578969248166

console.log(Math.acosh(2.5));
// Expected output: 1.566799236972411

Syntax

js
Math.acosh(x)

Parameter

x

Eine Zahl, die größer als oder gleich 1 ist.

Rückgabewert

Der inverse hyperbolische Kosinus von x. Wenn x kleiner als 1 ist, gibt NaN zurück.

Beschreibung

Da acosh() eine statische Methode von Math ist, wird sie immer als Math.acosh() genutzt, anstatt als Methode eines selbst erstellten Math-Objekts (Math ist kein Konstruktor).

Beispiele

Verwendung von Math.acosh()

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

Spezifikationen

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

Browser-Kompatibilität

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

Siehe auch