1
$\begingroup$

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?

  • 0
    The expression $165.377878-240/57.234100-160$ means $165.377878-(240/57.234100)-160$. It is not the same as $(165.377878-240)/(57.234100-160)$. ${}\qquad{}$2014-05-26

2 Answers 2