Use atan2() instead of atan()