Math.sin() Function

Math.sin() method in Javascript.
How to calculate sine value of a number in javascript?


Math Function:
Object: Math
Method: Math.sin()
Description: To get the sine value for a number specified in radians. The function returns a value between -1 and 1 for the given angle. For example lets try to calculate sine value for numbers "1","2".


<script type="text/javascript">
document.write('Sine value of 2 is::'+Math.sin(2));
document.write('Sine value of 1 is::'+Math.sin(1));


In the above example,
  • Math.sin() method returns the sine value of "2" as "0.909297".
  • Next the sine of "1" is got as "0.841470".

Ask Questions

Ask Question