Re: Mathematical functions in PHP The atan2() function returns the angle theta of an (x,y) point as a numeric value between -PI and PI radians.
<?php
echo(atan2(0.50,0.50) . "<br />");
echo(atan2(-0.50,-0.50) . "<br />");
echo(atan2(5,5) . "<br />");
echo(atan2(10,20) . "<br />");
echo(atan2(-5,-5) . "<br />");
echo(atan2(-10,10))
?>
ans
0.785398163397
-2.35619449019
0.785398163397
0.463647609001
-2.35619449019
-0.785398163397 |