--- title: Math.atanh() slug: Web/JavaScript/Reference/Global_Objects/Math/atanh tags: - JavaScript - Math - Method - Reference translation_of: Web/JavaScript/Reference/Global_Objects/Math/atanh ---
Math.atanh()
関数は、数値の双曲線逆正接 (ハイパーボリックアークタンジェント) を返します。
Math.atanh(x)
x
与えられた数値の双曲線逆正接 (ハイパーボリックアークタンジェント) です。
atanh()
は Math
の静的メソッドであるため、生成した Math
オブジェクトのメソッドとしてではなく、常に Math.atanh()
として使用するようにしてください (Math
はコンストラクターではありません)。
Math.atanh(-2); // NaN Math.atanh(-1); // -Infinity Math.atanh(0); // 0 Math.atanh(0.5); // 0.5493061443340548 Math.atanh(1); // Infinity Math.atanh(2); // NaN
1よりも大きな値もしくは -1 よりも小さな値に対しては、 {{jsxref("NaN")}} が返されます。
に対して、 になり、次の関数でエミュレートできます。
Math.atanh = Math.atanh || function(x) { return Math.log((1+x)/(1-x)) / 2; };
仕様書 |
---|
{{SpecName('ESDraft', '#sec-math.atanh', 'Math.atanh')}} |
{{Compat("javascript.builtins.Math.atanh")}}