Answers for "math sin in js"

1

sin in javascript

Math.sin(Math.PI / 2);//it uses radians, pi/2 = 90 degrees, output:1
//make a function 
const DegToRad = num => {return num * Math.PI / 180;};
Math.sin(DegToRad(90));//now its easy to read, output still 1
Posted by: Guest on July-15-2021
0

javaScript Math.sin()

Math.sin(90 * Math.PI / 180);     // returns 1 (the sine of 90 degrees)
Posted by: Guest on May-22-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language