Math.tan() Method is used to return the tangent of a number (angle). The tan method returns a numeric value that represents the tangent of the angle.
Syntax:
Math.tan(x)
Example:
<script> var one = Math.tan(90); document.writeln('Output of 90 : ' + one + '</br></br>'); var two = Math.tan(45); document.writeln('Output of 45 : ' + two + '</br></br>'); var three = Math.tan(30); document.writeln('Output of 30 : ' + three + '</br></br>'); var four = Math.tan(Math.PI/45); document.writeln('Output of Math.PI/45 : ' + four + '</br></br>'); </script>
Output:
Output of 90 : -1.995200412208242 Output of 45 : 1.6197751905438615 Output of 30 : -6.405331196646276 Output of Math.PI/45 : 0.06992681194351041