# Atan2 - Dealing with non-standard coordinate systems when calculating angles

I am trying to use atan2 to calculate the angle between two points. With atan2, angles increase counterclockwise, and zero is to the right i.e. The angle originates at positive x, increases up into positive y, swinging round to 180 degrees.

I am using a coordinate system where the "up" axis is actually negative, so values decrease going up the y axis instead of increase. Additionally my x-axis could flip where the right becomes negative.

Is there any easy way to account for my non-standard axis, either in the angle output or to standardise the coordinates before I call atan2?

• try $X=-x$ and $Y=-y$ – John Joy Oct 17 '15 at 14:44
• Oh, so I just need to negate the values of the point difference before calling atan2 and that's it?! – GenericJoe Oct 17 '15 at 17:57
• Perhaps thats all you need to do, although, depending upon the application you may need to shift the origin up or down (or left or right) or stretch or compress the coordinates. For some applications, you also need to rotate the axes. – John Joy Oct 17 '15 at 20:08