One of the great mysteries to me is how Blender takes a 2D input of the mouse moving on the screen and calculates a 3D rotation or translation using that input. Oftentimes when I move something it looks correct from the angles that I am looking at it, but when I rotate the viewport it did something seemingly random in a axis that I couldn't see.
So how exactly does Blender evaluate my 2D input of my mouse into a 3D translation or rotation?