For a description of quaternions and their use, see:

Ken Shoemake Animating Rotation with Quaternion Curves Computer Graphics, Vol. 18 No. 3, July 1985, SIGGraph '85 Proceedings