Home >>JavaScript Math Reference >JavaScript sin() Method

JavaScript sin() Method

JavaScript sin() Method

JavaScript Math.sin() method in JavaScript is used to return a numeric value between -1 and 1, which represents the sine of the angle. Sin() is a static method of a Math, you always used it as Math.sin(), rather than you created as a method of a math object.

Syntax:
Math.sin(value)

Parameter Values

Parameter Description
x It required a number

Browser Support

Method Chrome Edge Firefox Safari Opera
sin() Yes Yes Yes Yes Yes
Here is an example of JavaScript pow() Method:
<html>
<body>
<button onclick="mySin()">Click me</button>
<p id="sin"></p>
<script>
function mySin() 
{
  document.getElementById("sin").innerHTML = Math.sin(8);
}
</script>
</body>
</html>
Output:

Example 2:
<html>
<body>
<script> 
document.write("Output : " + Math.sin(0)); 
</script> 
</body>
</html>
Output: