JavaScript Math Object : tan()

The tan() method returns the tangent of an angle. Syntax :
  Math.tan( number );
Example :
<script>
  var x = -1;
  var y = Math.tan(x);
  document.write("tan(-1) : " + y + "<br/>");
  var x = 5;
  var y = Math.tan(x);
  document.write("tan(5) : " + y + "<br/>");
  var x = 30;
  var y = Math.tan(x);
  document.write("tan(30) : " + y + "<br/>");
  var x = 45;
  var y = Math.tan(x);
  document.write("tan(45) : " + y + "<br/>");
</script>
Output :


Next Topic :