PHP sin () function
Examples
Returns the sine of different numbers:
<?php
echo(sin(3) . "<br>");
echo(sin(-3) . "<br>");
echo(sin(0) . "<br>");
echo(sin(M_PI) . "<br>");
echo(sin(M_PI_2));
?>
echo(sin(3) . "<br>");
echo(sin(-3) . "<br>");
echo(sin(0) . "<br>");
echo(sin(M_PI) . "<br>");
echo(sin(M_PI_2));
?>
Running instance »
Definition and Usage
sin () function returns the sine of a number.
grammar
sin( number );
参数 | 描述 |
---|---|
number | 必需。规定一个弧度值。 |
technical details
return value: | number of sine. |
---|---|
Return type: | Float |
PHP version: | 4+ |
PHP Math Reference