Atan2 to odwrotna funkcja trygonometryczna - arcus tangens, tylko w wersji dwuargumentowej.
For any real number (e.g., floating point) arguments x and y not both equal to zero, atan2(y, x) is the angle in radians between the positive x-axis of a plane and the point given by the coordinates (x, y) on it. The angle is positive for counter-clockwise angles (upper half-plane, y > 0), and negative for clockwise angles (lower half-plane, y < 0).
Mnożenie przez 180 i dzielenie przez liczbę pi, to z kolei konwersja na stopnie z radianów.
http://www.freescale.com/files/sensors/doc/app_note/AN3461.pdf (chyba równanie 25, tylko wersja uproszczona, bo ignorujemy jedną oś obrotu).