Why is it that the parameters to the atan2 function are “backwards”? Ie, why does it accepts coordinates in the form y, x
instead of the standard x, y
?
views:
85answers:
3
+9
A:
Because it's similar to atan(y / x)
, with y
as numerator and x
as denominator.
Sheldon L. Cooper
2010-09-30 15:53:15
+6
A:
Probably because atan2(y,x) = atan(y/x) ± nπ
and here, y
and x
come in the same order.
Benoit
2010-09-30 15:54:35
+3
A:
The single argument version of arctangent requires the ratio of opposite divided by adjacent sides. This is y/x. It's fairly similar to say atan2(y,x) as it's remenicent of atan(y/x).
JoshD
2010-09-30 15:56:18