# Why the dramatic difference in the arc tangent?

Why are the two following calculations so dramatically different in results?

Given ATAN(y2 - y1 / x2 - x1)

Atan(165.377838 - 240 / 57.234100 - 160) = 0.8696708890423176

Atan(159.340393 - 240 / 61.901459 - 160) = -1.3538428308947705


I am calculating all of the points on a circle, and when I reach from approximately 45 to 135 degrees, rotating counterclockwise, all of my results go from positive to negative, and giving me sparatic results, such as above. The result of the arctangent, every where else in the rotation, is around a 1.43 to 1.53, but in this area they go negative and drop full integer.

Any ideas why this is happening?

-
Actually, if he's doing what I think he's doing, the two-argument arctangent might be a better thing to use: atan2(y2 - y1, x2 - x1)... –  Ｊ. Ｍ. Jul 15 '11 at 3:51