Returns the cosine of a number.
Math
cos(x)
x
The cos method returns a numeric value between -1 and 1, which represents the cosine of the angle.
cos is a static method of Math. As a result, you always use it as Math.cos(), rather than as a method of a Math object you create.
The following function returns the cosine of the variable x:
If x equals Math.PI/2, getCos returns 6.123031769111886e-017; if x equals Math.PI, getCos returns -1.
Math:acos, Math.asin, Math.atan, Math.atan2, Math.sin, Math.tan