Computer >> Computer tutorials >  >> Programming >> Javascript

Math.tan() function in JavaScript


The tan() function of the Math object accepts an angle (in radians) and returns its tangent value.

Syntax

Its Syntax is as follows

Math.tan(90)

Example

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var result = Math.tan(90);
      document.write("Tangent value of the given angle: "+result);
   </script>
</body>
</html>

Output

Tangent value of the given angle: -1.995200412208242