--- title: Math.acosh() slug: Web/JavaScript/Reference/Global_Objects/Math/acosh tags: - JavaScript - Math - Method - Reference translation_of: Web/JavaScript/Reference/Global_Objects/Math/acosh ---
{{JSRef}}

Math.acosh() 関数は、数値の双曲線余弦 (ハイパーボリックアークコサイン) を返します。

x1,Math.acosh(x)=arcosh(x)= the unique y0such thatcosh(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

{{EmbedInteractiveExample("pages/js/math-acosh.html")}}

構文

Math.acosh(x)

引数

x
数値。

返値

与えられた数値の双曲線余弦 (ハイパーボリックアークコサイン) です。数値が 1 未満であれば、 {{jsxref("NaN")}} になります。

解説

acosh()Math の静的メソッドであるため、作成した Math オブジェクトのメソッドとしてではなく、常に Math.acosh() として使用するようにしてください (Math はコンストラクターではありません)。

Math.acosh() の使用

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

1 未満の値に対しては、 Math.acosh() は {{jsxref("NaN")}} を返します。

ポリフィル

x1x \geq 1に対して、arcosh(x)=ln(x+x2-1)\operatorname {arcosh} (x) = \ln \left(x + \sqrt{x^{2} - 1} \right) になり、次の関数でエミュレートできます。

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

仕様書

仕様書
{{SpecName('ESDraft', '#sec-math.acosh', 'Math.acosh')}}

ブラウザーの互換性

{{Compat("javascript.builtins.Math.acosh")}}

関連情報