IDL is behaving properly. Try this to prove it: Y = -2.48664 X = -1.7322 DIV = Y/X theta = ATAN(Y,X) theta1 = ATAN(DIV) print, theta*180/!pi print, theta1*180/!pi You will get: -124.861 55.1388 The first value is where you input Y and X directly. IDL knows both are negative, so the resulting angle is the in the 3rd quadrant (-124.861 degrees). However, when you do the division on your own and enter it, the negatives are not known to ATAN and the angle resolve is 180 degrees rotates in the 1st quadrant (55.1388 degrees). Remember that tangent calculations require context to know which quadrant is correct.
|