JavaScript中的Math.asin()函数
asin()Math对象的函数接受一个数字,并以弧度返回其反正弦值。要将结果值转换为度数,请将其乘以180,然后将结果除以3.14159(pi值)。
语法
其语法如下
Math.asin(0.5)
示例
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var result = Math.asin(0.5);
document.write("arcsine value: "+result);
document.write("<br>");
document.write("arcsine value in degrees: "+result*180/Math.PI);
</script>
</body>
</html>输出结果
arcsine value: 0.5235987755982989 arcsine value in degrees: 30.000000000000004