アークサインを返します.
Math.asin(x)
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
スポンサード リンク