The Math.sin()
function returns the sine of a number in radians.
Math.sin(x) // x is number in radians.
The Math.sin()
method returns a numeric value between -1 and 1.
let a = Math.sin(0); // 0 console.log(a);//from www .j av a 2 s . c o m a = Math.sin(1); // 0.8414709848078965 console.log(a); a = Math.sin(Math.PI / 2); // 1 console.log(a);