Math.sin()
Math.sin(x) → number
Returns the sine of x.
Returns the sine of the angle x, given in radians. The result is in the range -1 to 1.
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| x | number | optional | — | An angle in radians. |
Returns
number
The sine of x.
Example
let s = Math.sin(Math.PI / 2); // 1