Originally Posted by
helloworld922
pseudo-code:
1. create a vector from point A to B (just subtract their coordinates)
2. Get the angle from the positive X axis (or any axis you want, this is easiest because there's a built in function to do this)
3. Use if/else statements to see which quadrant it's in, and return the appropriate response
in degrees (assuming all angles are measured counter-clockwise from the positive X-axis):
angle == 0: east
0 > angle < 90: north-east
angle == 90: north
90 > angle < 180: north-west
angle == 180: west
180 > angle < 270: south-west
angle == 270: south
270 > angle < 360: south-east
Thank's method created and it works like a charm.