Math.asin():返回數字的Math.asin()反正弦(以弧度為單位)

Math.asin():返回數字的Math.asin()反正弦(以弧度為單位)

// 以弧度計算直角三角形的角度
function calcAngle(opposite, hypotenuse) {
  return Math.asin(opposite / hypotenuse);
}

console.log(calcAngle(6, 10));
// Expected output: 0.6435011087932844

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