How to use sin in PHP

This article describe about sin() Function in PHP.
  • 1252

sin() Function

This function return the sine value of a number.

Syntax

sin(x)

 

Parameter Description
x Specified a number

Note: This function return a numeric value between -1 and 1.

Example

 

<html>
<body>
<?php
echo(sin(5) . "<br />");
echo(sin(-5) . "<br />");
echo(sin(0) . "<br />");
echo(sin(M_PI) . "<br />");
echo(sin(M_PI_2))
?>
</body>
</html>

 

Output


sin-php.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.