Facebook Page Twitter Page LinkedIn Page
× PHP Tutorial PHP Advanced PHP Resources


The PHP Math sin() function returns trigonometric sine of an angle (angle should be in radians).

Syntax

sin(number)

Parameters

number Required. Specify the angle in radian.

Return Value

Returns the trigonometric sine of an angle.

Example:

In the below example, sin() function is used to find out the trigonometric sine of an angle.

<?php
echo sin(pi()/6)."\n";
echo sin(pi()/4)."\n";
echo sin(pi()/3)."\n";  
?>

The output of the above code will be:

0.5
0.70710678118655
0.86602540378444

❮ PHP Math Functions

5