JavaScript math sin() method

The JavaScript math sin() method is used to get the sine of the given number.
Syntax:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Math.sin(n)
Math.sin(n)
Math.sin(n)

Parameters
n: It represents the number whose sine has to be got.

Returns
Sine of the given number.

Example:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<!DOCTYPE html>
<html>
<body>
<script>
document.writeln(Math.sin(5));
</script>
</body>
</html>
<!DOCTYPE html> <html> <body> <script> document.writeln(Math.sin(5)); </script> </body> </html>
<!DOCTYPE html>
<html>
<body>
<script>
document.writeln(Math.sin(5));
</script>
</body>
</html>