Return cosines of distinct numbers:
<?phpecho(cos(3) . "<br>");echo(cos(-3) . "<br>");echo(cos(0) . "<br>");echo(cos(M_PI ) . "<br>");echo(cos(2*M_PI));?>The cos() function returns the cosine of a number.
Note: The cos() function returns a number between -1 and 1, representing the cosine of the angle.
cos( number );
parameter | describe |
---|---|
number | Required. Specify a number. |
Return value: | The cosine of number . |
---|---|
Return type: | Float |
PHP version: | 4+ |