PHP: cos() function
Description
The cos() function is used to get the cosine of a number.
Version:
(PHP 4 and above)
Syntax:
cos(num)
Parameter:
Name | Description | Required / Optional |
Type |
---|---|---|---|
num | A number. | Required | Float |
Return value:
The cosine of num.
Value Type: Float.
Pictorial Presentation
Example:
Output:
Cosine of 0 is 1 Cosine of 4 is -0.653643620864 Cosine of -4 is -0.653643620864
View the example in the browser
See also