JavaScript Math.acos() 函数
Math.acos(x) -- 返回数字的反余弦值
- acos是arc cosine的缩写,中文"反余弦"的意思
- 引用网址:http://www.dreamdu.com/javascript/Math.acos/
acos函数语法
Math.acos(x);
acos函数参数
- x -- 为number类型的数字,此值必须在-1.0与1.0之间
acos函数返回值
返回x的反余弦值,此值为0与π(PI)之间的弧度
当参数x不在-1.0与1.0之间范围内,将返回NaN
acos函数示例
document.write(Math.acos(1));document.write(Math.acos(-1));document.write(Math.acos(8));
结果:
0 3.141592653589793 NaN