From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript Math Object
The cos() method returns the cosine of a number.
| Math.cos(x) |
| Parameter | Description |
|---|---|
| x | Required. A number |
Note: The cos() method returns a numeric value between -1 and 1, which represents the cosine of the angle.
ExampleReturn the cosine of different numbers:
The output of the code above will be:
Try it yourself » |
JavaScript Math Object
From http://www.w3schools.com (Copyright Refsnes Data)