PHP atan2() Function

The atan2() function is used to the angle theta of an (x,y) point as a numeric value between -PI and PI radians.

Demo :



Y Number :     X Number :  

Example :

Example 1: Y Number: 5  Example 2: X Number: 10

Following code useful to you for calculate the angle theta of an (x,y) point as a numeric value between -PI and PI radians.


<?php
 $atan2_x = 5;
 $atan2_y = 10;
 $result = atan2($atan2_x,$atan2_y);
 echo $result;
?>

In the above code is used to calculate for angle theta of an (x,y) point as a numeric value between -PI and PI radians.In the atan2() functions have used two parameters that name is float y , float x.

Free Download Script :

If you need atan2() function demo code download from following link.

Download




Content