Math.sin expects the input to be in radian, but you are expecting the result of 90 degree. Convert it to radian, like this

console.log(Math.sin(90 * Math.PI / 180.0));
# 1

As per the wikipedia's Radian to Degree conversion formula,

Angle in Radian = Angle in Degree * Math.PI / 180
Answer from thefourtheye on Stack Overflow
People also ask

What does Math.sin return in JavaScript?
Math.sin returns the sine of a number. The input must be in radians. The return value stays between -1 and 1. This lets you work with angles and trigonometry.
🌐
flatcoding.com
flatcoding.com › home › javascript math sin function with syntax and uses
JavaScript Math sin Function with Syntax and Uses - FlatCoding
Why does Math.sin(Math.PI) not return exactly 0?
It does not return 0 because of floating-point limits. The result may be a very small number close to 0. This happens with many math methods in JavaScript.
🌐
flatcoding.com
flatcoding.com › home › javascript math sin function with syntax and uses
JavaScript Math sin Function with Syntax and Uses - FlatCoding
What happens if I give a string to Math.sin?
If you give a string, JavaScript tries to convert it. If the string is not a valid number, it returns NaN. Always use a number to avoid errors.
🌐
flatcoding.com
flatcoding.com › home › javascript math sin function with syntax and uses
JavaScript Math sin Function with Syntax and Uses - FlatCoding
🌐
Math.js
mathjs.org › docs › reference › functions › sin.html
math.js | an extensive math library for JavaScript and Node.js
math.sin(2) // returns number 0.9092974268256813 math.sin(math.pi / 4) // returns number 0.7071067811865475 math.sin(math.unit(90, 'deg')) // returns number 1 math.sin(math.unit(30, 'deg')) // returns number 0.5 const angle = 0.2 math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number 1 ·
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-math-sin-method
JavaScript Math sin() Method - GeeksforGeeks
July 15, 2024 - The JavaScript Math sin( ) method in Javascript is used to return the sine of a number. The Math.sin() method returns a numeric value between -1 and 1, which represents the sine of the angle given in radians.
Find elsewhere
🌐
p5.js
p5js.org › reference › p5 › sin
sin
sin() calculates the sine of an angle, using radians by default, or according to if angleMode() setting (RADIANS or DEGREES).
🌐
TutorialsPoint
tutorialspoint.com › home › javascript › javascript math.sin() function
Understanding JavaScript Math.sin() Function
September 1, 2008 - The Math.sin() method in JavaScript is used to calculate the sune value of the provided number (in radians). This method returns a "numeric value" that represents sine value of a given angle (in radians).
🌐
FlatCoding
flatcoding.com › home › javascript math sin function with syntax and uses
JavaScript Math sin Function with Syntax and Uses - FlatCoding
June 27, 2025 - JavaScript Math.sin() gives the sine value of a number measured in radians. You must give a number as the input. This method comes from the Math object.
🌐
MarkLogic
docs.marklogic.com › 12.0 › math.sin
math.sin — MarkLogic 12 Product Documentation
XQuery math:sin · math.sin( x as Number ) as Number · Returns the sine of x, in the range from -1 to +1 (inclusive). math.sin(1.95) => 0.928959715003869 ·
🌐
MDN
mdn2.netlify.app › en-us › docs › web › javascript › reference › global_objects › math › sin
Math.sin() - JavaScript | MDN
July 20, 2021 - The sine of the given number. The Math.sin() method returns a numeric value between -1 and 1, which represents the sine of the angle given in radians.
🌐
Vultr Docs
docs.vultr.com › javascript › standard-library › Math › sin
JavaScript Math sin() - Calculate Sine Value | Vultr Docs
September 27, 2024 - This code converts 90 degrees to radians and calculates its sine, which famously results in 1. Embed Math.sin() within a custom function to compute sine for various angles.
🌐
Programiz
programiz.com › javascript › library › math › sin
JavaScript Math sin()
Become a certified JavaScript programmer. Try Programiz PRO! ... The sin() method computes the trigonometric sine of the specified angle and returns it. // sine of the angle 1 var value1 = Math.sin(1); console.log(value1); // Output: 0.8414709848078965
🌐
Three.js
discourse.threejs.org › questions
Javascript sin math - Questions - three.js forum
March 19, 2019 - Hello everyone, I managed to create a small 3D environment for my model… I’d like to showcase it interactively etc. This will be an ongoing work, as every day I learn more and more. Just in case this is the link to the project https://www.madquake.net/threejs/dualShock.html I have a question on how to script something in here.
🌐
University of Houston-Clear Lake
sceweb.uhcl.edu › helm › WEBPAGE-Javascript › my_files › Object › Module-7 › Mrthod › javascript__math_sin_method.html
JavaScript - Math sin Method
Returns the sine of a number. Try the following example program. <html> <head> <title>JavaScript Math sin() Method</title> </head> <body> <script type="text/javascript"> var value = Math.sin( 0.5 ); document.write("First Test Value : " + value ); var value = Math.sin( 90 ); document.write("<br ...
🌐
W3Schools
w3schools.com › js › js_math.asp
JavaScript Math Object
Math.trunc() and Math.sign() were added to JavaScript 2015 - ES6. Math.pow(x, y) returns the value of x to the power of y: ... Math.sin(x) returns the sine (a value between -1 and 1) of the angle x (given in radians).
🌐
Mozilla
interactive-examples.mdn.mozilla.net › pages › js › math-sin.html
JavaScript Demo: Math.sin()
function getCircleY(radians, radius) { return Math.sin(radians) * radius; } console.log(getCircleY(1, 10)); // Expected output: 8.414709848078965 console.log(getCircleY(2, 10)); // Expected output: 9.092974268256818 console.log(getCircleY(Math.PI, 10)); // Expected output: 1.2246467991473533e-15 ...