# full single rotation last pass strange behavior (incomplete X / Z rotation)

I have a strange behaviour of the pass between 2 last keyframes of X and Z axis in full single rotations - instead of snapping the original state the model rotates backwards, both in Blender and c++ code? where can the problem presumably be? I, not that deep into Blender to guess the reasons myself:( Applying the recorded video describing the said above - thank you :)
https://youtu.be/tw0JBH1Bobo

It is because of the way quaternions work. To perform a single rotation from q=(1,0,0,0) around axis (0,0,1) it will go from (1,0,0,0) through (0,0,0,1) and return to its original orientation as (-1,0,0,0). Now it may seem strange to start at (1,0,0,0) and end at (-1,0,0,0) and still be in the same orientation, but that is just the way quaternions work. q and -q represent the same orientation.
Since you aren't ending your spin at (-1,0,0,0) that means the animation system animates the figure unspinning instead of completing the spin.