You are here

function pSpring::getAngle in Visitors 7.2

Same name and namespace in other branches
  1. 7 pChart/class/pSpring.class.php \pSpring::getAngle()
2 calls to pSpring::getAngle()
pSpring::doPass in pChart/class/pSpring.class.php
pSpring::drawSpring in pChart/class/pSpring.class.php

File

pChart/class/pSpring.class.php, line 841

Class

pSpring

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);
  }
}