| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Math/acos | [Back] [Original] |
Get to know MDN better
Math.acos()
//
function calcAngle(adjacent, hypotenuse) {
return Math.acos(adjacent / hypotenuse);
}
console.log(calcAngle(8, 10));
// : 0.6435011087932843
console.log(calcAngle(5, 3));
// : NaN
Math.acos(x)
x x -1 1
-1 1 NaN
acos() Math Math Math.acos() (Math )
Math.acos(-2); // NaN
Math.acos(-1); // 3.141592653589793 ()
Math.acos(0); // 1.5707963267948966 (/2)
Math.acos(0.5); // 1.0471975511965979 (/3)
Math.acos(1); // 0
Math.acos(2); // NaN
| ECMAScript 2027 LanguageSpecification # sec-math.acos |
| Web Proxy Viewer | New URL | Original Page |