[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Math/acos [Back]  [Original]

Math.acos() - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

Math.acos()

Baseline

20157

Math.acos()

x[1,1],.()=arccos(x)=the unique y[0,] such that cos(y)=x\forall x \in [{-1}, 1],\;\mathtt{\operatorname{Math.acos}(x)} = \arccos(x) = \text{the unique } y \in [0, \pi] \text{ such that } \cos(y) = x

// 
function calcAngle(adjacent, hypotenuse) {
  return Math.acos(adjacent / hypotenuse);
}

console.log(calcAngle(8, 10));
// : 0.6435011087932843

console.log(calcAngle(5, 3));
// : NaN

js
Math.acos(x)

x

x -1 1

-1 1 NaN

acos() Math Math Math.acos() (Math )

Math.acos()

js
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