Javascript
 Computer >> コンピューター >  >> プログラミング >> Javascript

JavaScriptのMath.acos()関数


Mathオブジェクトのacos()関数は数値を受け取り、そのアークコサイン値をラジアンで返します。結果の値を度に変換するには、180を掛けて、結果を3.14159(円周率の値)で割ります。

構文

その構文は次のとおりです

Math.acos(0.5)

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

出力

arccosine value: 1.0471975511965979
arccosine value in degrees: 60.00000000000001

  1. JavaScriptのMath.tanh()関数

    Mathオブジェクトのtanh()関数は、角度(ラジアン)を受け入れ、その双曲線正接値を返します。 構文 その構文は次のとおりです Math.tanh(90) 例 <html> <head>    <title>JavaScript Example</title> </head> <body>    <script type="text/javascript">       var result = Math.tanh(

  2. JavaScriptのMath.tan()関数

    Mathオブジェクトのtan()関数は、角度(ラジアン)を受け入れ、そのタンジェント値を返します。 構文 その構文は次のとおりです Math.tan(90) 例 <html> <head>    <title>JavaScript Example</title> </head> <body>    <script type="text/javascript">       var result = Math.tan(90