From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../reference/global_objects/math/cosh/index.html | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/math/cosh/index.html (limited to 'files/ja/web/javascript/reference/global_objects/math/cosh') diff --git a/files/ja/web/javascript/reference/global_objects/math/cosh/index.html b/files/ja/web/javascript/reference/global_objects/math/cosh/index.html new file mode 100644 index 0000000000..087086fa4d --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/math/cosh/index.html @@ -0,0 +1,95 @@ +--- +title: Math.cosh() +slug: Web/JavaScript/Reference/Global_Objects/Math/cosh +tags: + - JavaScript + - Math + - Method + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/Math/cosh +--- +
{{JSRef}}
+ +

Math.cosh() 関数は、引数として与えた数の双曲線余弦 (ハイパーボリックコサイン) を返します。これは{{jsxref("Math.E", "定数 e", "", 1)}} を使用して次のように表すことができます。

+ +

Math.cosh(x)=ex+e-x2\mathtt{\operatorname{Math.cosh(x)}} = \frac{e^x + e^{-x}}{2}

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

構文

+ +
Math.cosh(x)
+ +

引数

+ +
+
x
+
数値。
+
+ +

返値

+ +

指定された数値の双曲線余弦 (ハイパーボリックコサイン) です。

+ +

解説

+ +

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

+ +

+ +

Math.cosh() の使用

+ +
Math.cosh(0);  // 1
+Math.cosh(1);  // 1.5430806348152437
+Math.cosh(-1); // 1.5430806348152437
+
+ +

ポリフィル

+ +

これは {{jsxref("Math.exp()")}} 関数を使用して次のようにエミュレートできます。

+ +
Math.cosh = Math.cosh || function(x) {
+  return (Math.exp(x) + Math.exp(-x)) / 2;
+}
+
+ +

または {{jsxref("Math.exp()")}} 関数を一度だけ呼び出すようにすると、次のようになります。

+ +
Math.cosh = Math.cosh || function(x) {
+  var y = Math.exp(x);
+  return (y + 1 / y) / 2;
+};
+
+ +

仕様書

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

ブラウザーの互換性

+ + + +

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

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf