Using atan2() makes this a breeze, no need for quadrant computation.