How to get the sine of a number in JavaScript?


To get the sine of a number, use the JavaScript sine() technique. The sin technique returns a numeric value between -1 and one, that represents the sine of the argument

Example

You can try to run the following code to get the sine of a number in JavaScript −

<html>
   <head>
      <title>JavaScript Math sin() Method</title>
   </head>
   <body>
      <script>
         var value = Math.sin( 0.5 );
         document.write("First Value : " + value );
         
         var value = Math.sin( 90 );
         document.write("<br>Second Value : " + value );
      </script>
   </body>
</html>

Updated on: 19-Jun-2020

139 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements