function pImage::getAngle

5.x pImage.class.php pImage::getAngle($X1, $Y1, $X2, $Y2)

File

inc/pchart/pchart/class/pImage.class.php, line 184

Class

pImage

Code

function getAngle($X1, $Y1, $X2, $Y2) 
 {
  $Opposite = $Y2 - $Y1;
  $Adjacent = $X2 - $X1;
  $Angle = rad2deg(atan2($Opposite, $Adjacent));
  if ($Angle > 0) {
    return ($Angle);
  }
  else {
    return (360 -abs($Angle));
  }
}