JavaScript Math Object : sin()

The sin() method returns the sine of given number, in radians. It basically returns a numeric value between -1 and 1, which represents the sine of the argument. Syntax :
  Math.sin( number );
Example :
<script>
  var x = -1;
  var y = Math.sin(x);
  document.write("sin(-1) : " + y + "<br/>");
  var x = 5;
  var y = Math.sin(x);
  document.write("sin(5) : " + y + "<br/>");
  var x = 30;
  var y = Math.sin(x);
  document.write("sin(30) : " + y + "<br/>");
  var x = 45;
  var y = Math.sin(x);
  document.write("sin(45) : " + y + "<br/>");
</script>
Output :



Next Topic :