Hi I have two points on 2d plane and need to work out the angle that they create relative to +x axis..

This is what I have come up with so far but it's too long and I'm sure there is a better way..

x = DistX - SrcX
y = DistY - SrcY
if y>0 and x>0 then Angle = ATN(abs(y)/abs(x))
if y>0 and x<0 then Angle = ATN(abs(x)/abs(y)) + 90
if y<0 and x<0 then Angle = ATN(abs(y)/abs(x)) + 180
if y<0 and x>0 then Angle = ATN(abs(x)/abs(y)) + 270