Posted By

mscribellito on 02/11/11


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

brownrl


Get Angle


 / Published in: PHP
 

get angle between two points (x1, y1) & (x2, y2)

  1. function getAngle($x1, $y1, $x2, $y2) {
  2. $dx = $x2 - $x1;
  3. $dy = $y2 - $y1;
  4. return atan2($dy, $dx);
  5. }

Report this snippet  

You need to login to post a comment.