sin

float sin(float num) 

Calculates the sine of a floating-point number.

Returns:

Floating-point sine value

Description:

Returns the sine for the argument passed in radians. Return values are from -1 to 1.

Version:

PHP 3, PHP 4

See also:

acos() 
asin() 
atan() 
atan2() 
cos() 
tan() 

Example:

Calculate the sine of a value
echo "The sine for the four cardinal points of a circle are:<br />\n"; 
echo "0 degrees: ", sin(0), "<br />\n"; 
echo "90 degrees: ", sin(pi() / 2), "<br />\n"; 
echo "180 degrees: ", sin(pi()), "<br />\n"; 
echo "270 degrees: ", sin(pi() + pi() / 2), "<br />\n"; 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.