Possible Duplicate:
what is the difference between atan and atan2 in c++ ?
Why is −π < atan2(y, x) ≤ π while for lines we really need only from 0 to π and what has api like atan2 but would return from 0 to pi?
Possible Duplicate:
what is the difference between atan and atan2 in c++ ?
Why is −π < atan2(y, x) ≤ π while for lines we really need only from 0 to π and what has api like atan2 but would return from 0 to pi?
One common application of
atan2
is converting from cartesian coordinates to polar coordinates. And that it supports all angles is its reason of existance. Else you could just useatan(y/x)
.