サイト内検索

Math メソッド一覧

スポンサー

ホーム > Math > asin

asin

アークサインを返します.

シンタックス

Math.asin(x)
  • x - 数値 (-1から1まで)

解説

asinメソッドはxのアークサインを-PI/2からPI/2までの範囲で返します.(ラジアン単位)
引数xは-1から1までである必要があります.この範囲以外である場合,このメソッドはNaNを返します.

サンプルコード

以下にasinメソッドを使用したサンプルコードを示します.

<html>
  <head>
    <title>asinメソッドのサンプルコード</title>
  </head>
  <body>
    <script type="text/javascript" language="javascript">
      document.write(Math.asin(-1) + "<br />");
      document.write(Math.asin(0) + "<br />");
      document.write(Math.asin(1) + "<br />");
      document.write(Math.asin(2));
    </script>
  </body>
</html>

実行例

サンプルコードの実行結果は以下のようになります.

-1.5707963267948966
0
1.5707963267948966
NaN

関連項目

スポンサード リンク

inserted by FC2 system