--- title: Math.asin() slug: Web/JavaScript/Reference/Global_Objects/Math/asin tags: - JavaScript - Math - Method - Reference translation_of: Web/JavaScript/Reference/Global_Objects/Math/asin --- <div>{{JSRef}}</div> <p><strong><code>Math.asin()</code></strong> 関数は、引数として与えた数値の逆正弦 (アークサイン) をラジアン単位で返します。</p> <p><math display="block"><semantics><mrow><mo>∀</mo><mi>x</mi><mo>∊</mo><mo stretchy="false">[</mo><mrow><mo>-</mo><mn>1</mn></mrow><mo>;</mo><mn>1</mn><mo stretchy="false">]</mo><mo>,</mo><mspace width="thickmathspace"></mspace><mstyle mathvariant="monospace"><mrow><mo lspace="0em" rspace="thinmathspace">Math.asin</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow></mstyle><mo>=</mo><mo lspace="0em" rspace="0em">arcsin</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo><mtext> the unique </mtext><mspace width="thickmathspace"></mspace><mi>y</mi><mo>∊</mo><mrow><mo>[</mo><mrow><mo>-</mo><mfrac><mi>π</mi><mn>2</mn></mfrac><mo>;</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></mrow><mo>]</mo></mrow><mspace width="thinmathspace"></mspace><mtext>such that</mtext><mspace width="thickmathspace"></mspace><mo lspace="0em" rspace="0em">sin</mo><mo stretchy="false">(</mo><mi>y</mi><mo stretchy="false">)</mo><mo>=</mo><mi>x</mi></mrow><annotation encoding="TeX">\forall x \in [{-1};1],\;\mathtt{\operatorname{Math.asin}(x)} = \arcsin(x) = \text{ the unique } \; y \in \left[-\frac{\pi}{2}; \frac{\pi}{2}\right] \, \text{such that} \; \sin(y) = x</annotation></semantics></math></p> <div>{{EmbedInteractiveExample("pages/js/math-asin.html")}}</div> <div class="hidden">このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> をクローンしてプルリクエストを送信してください。</div> <h2 id="Syntax" name="Syntax">構文</h2> <pre class="syntaxbox notranslate"><code>Math.asin(<var>x</var>)</code></pre> <h3 id="Parameters" name="Parameters">引数</h3> <dl> <dt><code><var>x</var></code></dt> <dd>数値です。</dd> </dl> <h3 id="Return_value" name="Return_value">返値</h3> <p>与えられた数値が <strong>-1</strong> から <strong>1</strong> までの場合、その逆正弦 (アークサイン) をラジアン単位で返します。さもなければ、 {{jsxref("NaN")}} を返します。</p> <h2 id="Description" name="Description">解説</h2> <p><code>Math.asin()</code> メソッドは、 <code>-1</code> から <code>1</code> までの <var>x</var> に対して、 <math><semantics><mrow><mo>-</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></mrow><annotation encoding="TeX">-\frac{\pi}{2}</annotation></semantics></math> から <math><semantics><mfrac><mi>π</mi><mn>2</mn></mfrac><annotation encoding="TeX">\frac{\pi}{2}</annotation></semantics></math> までのラジアンの数値を返します。 <var>x</var> の値がこの範囲を越えている場合、このメソッドは {{jsxref("NaN")}} を返します。</p> <p><code>asin()</code> は <code>Math</code> の静的メソッドであるため、生成した <code>Math</code> オブジェクトのメソッドとしてではなく、常に <code>Math.asin()</code> として使用するようにしてください (<code>Math</code> はコンストラクターではありません)。</p> <h2 id="Examples" name="Examples">例</h2> <h3 id="Using_Math.asin" name="Using_Math.asin">Math.asin() の使用</h3> <pre class="brush: js notranslate">Math.asin(-2); // NaN Math.asin(-1); // -1.5707963267948966 (-pi/2) Math.asin(0); // 0 Math.asin(0.5); // 0.5235987755982989 Math.asin(1); // 1.5707963267948966 (pi/2) Math.asin(2); // NaN </pre> <p>値が -1 未満か 1 より大きい数値の場合、<code>Math.asin()</code> は {{jsxref("NaN")}} を返します。</p> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('ESDraft', '#sec-math.asin', 'Math.asin')}}</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <p>{{Compat("javascript.builtins.Math.asin")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li>{{jsxref("Math.acos()")}}</li> <li>{{jsxref("Math.atan()")}}</li> <li>{{jsxref("Math.atan2()")}}</li> <li>{{jsxref("Math.cos()")}}</li> <li>{{jsxref("Math.sin()")}}</li> <li>{{jsxref("Math.tan()")}}</li> </ul>