asin【アークサイン (逆正弦):arc-sine】
acos【アークコサイン (逆余弦):arc-cosine】
atan【アークタンジェント (逆正接):arc-tangent】
atan2【y/x のアークタンジェント (逆正接)】
メモ
- 逆三角関数:アークサイン 【逆正弦】・アークコサイン 【逆余弦】・アークタンジェント 【逆正接】 ・y/x のアークタンジェント 【逆正接】
Math.asin【アークサイン (逆正弦):arc-sine】
メモ
概要
- アークサイン (逆正弦)を取得
関連
外部リンク
- ECMA-262 (英語)
Math.asin ( x ) ES2024 (15) ES2023 (14) ES2022 (13)
構文
Math.asin( x )
アークサイン (ラジアン単位:-π/2 ~ +π/2)
(引数が特殊な場合は下記参照)
x数値 (-1 ~ 1)
特殊仕様 x | 戻り値 |
---|---|
数値以外 | 数値に変換して処理 |
NaN | NaN |
1 < | NaN |
< (-1) | NaN |
+0 | +0 |
-0 | -0 |
例
console.log(Math.asin(-1));
// 出力:-1.570796... (-π/2)
console.log(Math.asin(+1));
// 出力:1.570796... (+π/2)
console.log(Math.asin(NaN));
// 出力:NaN
console.log(Math.asin(2));
// 出力:NaN
console.log(Math.asin(-0));
// 出力:-0
console.log(Math.asin(+0));
// 出力:0
Math.acos【アークコサイン (逆余弦):arc-cosine】
メモ
概要
- アークコサイン (逆余弦)を取得
関連
外部リンク
- ECMA-262 (英語)
Math.acos ( x ) ES2024 (15) ES2023 (14) ES2022 (13)
構文
Math.acos( x )
アークコサイン (ラジアン単位:+0 ~ +π)
(引数が特殊な場合は下記参照)
x数値 (-1 ~ 1)
特殊仕様 x | 戻り値 |
---|---|
数値以外 | 数値に変換して処理 |
NaN | NaN |
1 < x | NaN |
x < (-1) | NaN |
1 | +0 |
例
console.log(Math.acos(-1));
// 出力:3.141592... (π)
console.log(Math.acos(1));
// 出力:0
console.log(Math.acos(NaN));
// 出力:NaN
console.log(Math.acos(2));
// 出力:NaN
Math.atan【アークタンジェント (逆正接):arc-tangent】
メモ
概要
- アークタンジェント (逆正接)を取得
関連
外部リンク
- ECMA-262 (英語)
Math.atan ( x ) ES2024 (15) ES2023 (14) ES2022 (13)
構文
Math.atan( x )
アークタンジェント(ラジアン単位:-π/2 ~ +π/2)
(引数が特殊な場合は下記参照)
x数値
特殊仕様 x | 戻り値 |
---|---|
数値以外 | 数値に変換して処理 |
NaN | NaN |
+0 | +0 |
-0 | -0 |
+∞ | +π/2 |
-∞ | -π/2 |
例
console.log(Math.atan(1));
// 出力:0.7853981633974483 (π/4)
console.log(Math.atan(NaN));
// 出力:NaN
console.log(Math.atan(-0));
// 出力:-0
console.log(Math.atan(+0));
// 出力:0
console.log(Math.atan(+Infinity));
// 出力:1.570796... (+π/2)
console.log(Math.atan(-Infinity));
// 出力:-1.570796... (-π/2)
Math.atan2【y/x のアークタンジェント (逆正接)】
メモ
概要
- y/x のアークタンジェント (逆正接)を取得
関連
外部リンク
- ECMA-262 (英語)
Math.atan2 ( y, x ) ES2024 (15) ES2023 (14) ES2022 (13)
構文
Math.atan2( y, x )
x軸から座標 (y,x) までの逆時計回りの角度 (ラジアン単位)
(引数が特殊な場合は下記参照)
yy座標
xx座標
特殊仕様 y | x | 戻り値 |
---|---|---|
数値以外 | 数値以外 | 数値に変換して処理 |
任意 | NaN | NaN |
NaN | 任意 | NaN |
0 < y | +0 | ≒ +π/2 |
0 < y | −0 | ≒ +π/2 |
+0 | 0 < x | +0 |
+0 | +0 | +0 |
+0 | −0 | ≒ +π |
+0 | x < 0 | ≒ +π |
−0 | 0 < x | −0 |
−0 | +0 | −0 |
−0 | −0 | ≒ −π |
−0 | x < 0 | ≒ −π |
y < 0 | +0 | ≒ −π/2 |
y < 0 | −0 | ≒ −π/2 |
0 < (有限数) | +∞ | +0 |
0 < (有限数) | −∞ | ≒ +π |
< 0 (有限数) | +∞ | −0 |
< 0 (有限数) | −∞ | ≒ −π |
+∞ | 有限数 | ≒ +π/2 |
−∞ | 有限数 | ≒ −π/2 |
+∞ | +∞ | ≒ +π/4 |
+∞ | −∞ | ≒ +3π/4 |
−∞ | +∞ | ≒ −π/4 |
−∞ | −∞ | ≒ −3π/4 |
例
console.log(Math.atan2(1, 1));
// 出力:≒ +π/2
console.log(Math.atan2(1, NaN));
// 出力:NaN
console.log(Math.atan2(NaN, 1));
// 出力:NaN
console.log(Math.atan2(1, +0));
// 出力:≒ +π/2
console.log(Math.atan2(1, -0));
// 出力:≒ +π/2
console.log(Math.atan2(+0, 1));
// 出力:0
console.log(Math.atan2(+0, +0));
// 出力:0
console.log(Math.atan2(+0, -0));
// 出力:≒ +π
console.log(Math.atan2(+0, -1));
// 出力:≒ +π
console.log(Math.atan2(-0, 1));
// 出力:-0
console.log(Math.atan2(-0, +0));
// 出力:-0
console.log(Math.atan2(-0, -0));
// 出力:≒ -π
console.log(Math.atan2(-0, -1));
// 出力:≒ -π
console.log(Math.atan2(-1, +0));
// 出力:≒ −π/2
console.log(Math.atan2(-1, -0));
// 出力:≒ −π/2
console.log(Math.atan2(1, +Infinity));
// 出力:+0
console.log(Math.atan2(1, -Infinity));
// 出力:≒ +π
console.log(Math.atan2(-1, +Infinity));
// 出力:-0
console.log(Math.atan2(-1, -Infinity));
// 出力:≒ -π
console.log(Math.atan2(+Infinity, 1));
// 出力:≒ +π/2
console.log(Math.atan2(-Infinity, 1));
// 出力:≒ −π/2
console.log(Math.atan2(+Infinity, +Infinity));
// 出力:≒ +π/4
console.log(Math.atan2(+Infinity, -Infinity));
// 出力:+3π/4
console.log(Math.atan2(-Infinity, +Infinity));
// 出力:−π/4
console.log(Math.atan2(-Infinity, -Infinity));
// 出力:−3π/4