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