Math.sin() Function

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

Explanation

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".

Example:


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

Result:




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