Returns the sine of a number.
Method of Math
Static
Syntax
sin( x )
Parameters
Parameter | Description |
---|---|
x | A number |
Description
The sin method returns a numeric value between -1 and 1, which represents the sine of the argument.
Because sin is a static method of Math, you always use it as Math.sin(), rather than as a method of a Math object you created.
Examples
The following function returns the sine of the variable x:
If you pass getSine the value Math.PI/2, it returns 1.
See also
Math.acos, Math.asin, Math.atan, Math.atan2, Math.cos, Math.tan