Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
 
PREVIOUS NEXT
Tagged: #sin #javascript
ADD COMMENT
Topic
Name
6+2 =