Return the cosine of different numbers:
<?php
echo(cos(3) . "<br>");
echo(cos(-3) . "<br>");
echo(cos(0) . "<br>");
echo(cos(M_PI) . "<br>");
echo(cos(2*M_PI));
?>
Try it Yourself »
The cos() function returns the cosine of a number.
Note: The cos() function returns a numeric value between -1 and 1, which represents the cosine of the angle.
cos(
number);
Parameter | Description |
---|---|
number | Required. Specifies a number |
Return Value: | The cosine of number |
---|---|
Return Type: | Float |
PHP Version: | 4+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!