ATN2(x,y) returns the angle between the positive real x-axis and a vector to the point (x,y). Positive angles are counter-clockwise from the x axis. ATN2 returns a value in the range of -PI to PI radians or -180 to 180 degrees, depending on the current trigonometric mode. ATN2(0,0) is undefined and causes an error.
ATN2(y,x) is so named because of its similarity to ATN(y/x). However, ATN(y/x) does not calculate correct angles for points in the 2nd and 3rd quadrants. In some languages, this function is named ANGLE(x,y). In HTBasic, it is named ATN2(y,x) to match HP Series 80 BASIC.