I have two points, (x1,y1)
and (x2,y2)
, that I'd like to draw a line between. I know I can figure out the angle (in degrees) of that line using arctangent and the slope:
atan((y2-y1)/(x2-x1))*180/pi
However, how would I convert this angle to a [0,360] scale? Basically, I want my angle to be on a compass scale in which "North" is 0 deg, "East" is 90 deg, "South" is 180 deg, and "West" is 270 deg.
Thanks!