Latest web development tutorials
 

PHP sin() Function

< PHP Math Reference

Example

Return 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));
?>
Run example »

Definition and Usage

The sin() function returns the sine of a number.


Syntax

sin(number);

Parameter Description
number Required. Specifies a value in radians

Technical Details

Return Value: The sine of number
Return Type: Float
PHP Version: 4+

< PHP Math Reference