JavaScript中Math.asinh()和Math.acosh()函数的用途是什么?

Math.asinh()Math.acosh()函数分别用于查找数字的双曲反正弦双曲余弦。这些功能是静态方法数学,所以它们总是用作Math.asinh()Math.acosh(),而不是作为创建一个数学对象的方法。

Math.asinh()

此方法用于查找数字的双曲反正弦。它以数字作为参数,并返回双曲正弦值

示例

<html>
<body>
<script>
   document.write(Math.asinh(2));
   document.write("</br>");
   document.write(Math.asinh(7));
</script>
</body>
</html>

输出结果

1.4436354751788103
2.644120761058629


Math.acosh()

此方法用于查找数字的双曲反余弦。它以数字作为参数,并返回双曲余弦值

示例

<html>
<body>
<script>
   document.write(Math.acosh(2));
   document.write("</br>");
   document.write(Math.acosh(7));
</script>
</body>
</html>

输出结果

1.3169578969248166
2.6339157938496336