Computer >> Máy Tính >  >> Lập trình >> Javascript

Hàm Math.atanh () trong JavaScript

Hàm atanh () của đối tượng Math chấp nhận một số và trả về giá trị cung tròn hypebol tính bằng radian. Để chuyển giá trị kết quả thành độ, hãy nhân nó với 180 và chia kết quả cho 3,14159 (giá trị pi).

Cú pháp

Cú pháp của nó như sau

Math.atanh(0.5)

Ví dụ

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var result = Math.atanh(0.5);
      document.write("arctangent value: "+result);
      document.write("<br>");
      document.write("hyperbolic arctangent value in degrees: "+result*180/Math.PI);
   </script>
</body>
</html>

Đầu ra

arctangent value: 0.5493061443340548
arctangent value in degrees: 31.47292373094538