ES6 - Math.sin(x) Function



This function returns the sine of x radians.

Syntax

Math.sin(x)      

Parameter

  • X1 − represents a number

Example

console.log("---Math.sin()---") 
console.log("Math.sin(Math.PI/2): "+Math.sin(Math.PI/2)) 
console.log("Math.sin(Math.PI/4): "+Math.sin(Math.PI/4))           

Output

---Math.sin()--- 
Math.sin(Math.PI/2): 1 
Math.sin(Math.PI/4): 0.7071067811865475       
Advertisements