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/atan/index.html | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/math/atan/index.html (limited to 'files/ja/web/javascript/reference/global_objects/math/atan/index.html') diff --git a/files/ja/web/javascript/reference/global_objects/math/atan/index.html b/files/ja/web/javascript/reference/global_objects/math/atan/index.html new file mode 100644 index 0000000000..3c71b12b6d --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/math/atan/index.html @@ -0,0 +1,89 @@ +--- +title: Math.atan() +slug: Web/JavaScript/Reference/Global_Objects/Math/atan +tags: + - JavaScript + - Math + - Method + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/Math/atan +--- +
{{JSRef}}
+ +

Math.atan() 関数は、引数として与えた数値のアークタンジェントをラジアン単位で返します。

+ +

Math.atan(x)=arctan(x)= the unique y[-π2;π2]such thattan(y)=x\mathtt{\operatorname{Math.atan}(x)} = \arctan(x) = \text{ the unique } \; y \in \left[-\frac{\pi}{2}; \frac{\pi}{2}\right] \, \text{such that} \; \tan(y) = x

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

構文

+ +
Math.atan(x)
+ +

引数

+ +
+
x
+
数値です。
+
+ +

返値

+ +

与えられた数値のアークタンジェント (ラジアン単位) です。

+ +

解説

+ +

Math.atan() メソッドは -π2-\frac{\pi}{2} から π2\frac{\pi}{2} までのラジアンの数値を返します。

+ +

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

+ +

+ +

Math.atan() の使用

+ +
Math.atan(1);   // 0.7853981633974483
+Math.atan(0);   // 0
+Math.atan(-0);  // -0
+
+Math.atan(Infinity);   //  1.5707963267948966
+Math.atan(-Infinity);  // -1.5707963267948966
+
+// The angle that the line [(0,0);(x,y)] forms with the x-axis in a Cartesian coordinate system
+Math.atan(y / x);
+
+ +

様式上の理由から ±Infinity の使用を避けたいと思うことがあるかもしれません。その場合、 {{jsxref("Math.atan2()")}} を第二引数を 0 としてを使うとよりよいかもしれません。

+ +

仕様書

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

ブラウザーの互換性

+ + + +

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

+ +

関連情報

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