Sample Rotations
In order to try to explain things and give some examples we can try I thought it might help to show the rotations for a finite subset of the rotation group. We will use the set of rotations of a cube onto itself, this is a permutation group which gives 24 possible rotations as explaned on this page.
In the following table we will need to know what quadrant the results are in, so I have taken some sample results from Math.atan2
heading applied first giving 4 possible orientations: