Complete PHP Math Reference
The cos() function returns the cosine of a number.
| Parameter | Description |
|---|---|
| x | Required. A number |
Note: The cos() function returns a numeric value between -1 and 1, which represents the cosine of the angle.
In the following example we will return the cosine of different numbers:
The output of the code above will be:
Complete PHP Math Reference
Your message has been sent to W3Schools.