PHP sin()


PHP sin(x) function returns the sine value of radian angle x. The principle values for x is [-∞,∞].

<?PHP
	echo sin(M_PI); //1.2246467991474E-16
	echo sin(M_PI/2);  //1
?>

deg2rad() function can be used to convert degree to radian angle.
<?PHP
	echo sin(deg2rad(60));  //0.86602540378444
	echo sin(deg2rad(30));  //0.5
?>

Sine y=sin(x) Graph
X
(deg)
X
(Rad)
Y=sine(X)
180 ̊ π 0
150 ̊ 5π/6 0.5
135 ̊ 3π/4 0.707107
120 ̊ 2π/3 0.866025
90 ̊ π/2 1
60 ̊ π/3 0.866025
45 ̊ π/4 0.707107
30 ̊ π/6 0.5
0 ̊ 0 0