I wrote a blog post about rotation matrices and how they can be derived using a mathematical technique called an "infinitesimal generator", and I use it to figure out the nasty formula for axis-angle rotations from first principles. Maybe some people here will be interested in this...warning, heavy mathematics ahead! :yes:
Just a question; In what situation would a axis-and-angle be a suitable representation of a rotation?
I usually store quaternions, since they are easy to use, and use angle-axis for input since they are easy to visualize.
Yes, quaternions have several advantages as an internal representation of rotation for a physics engine or computer graphics. The axis-angle thing was more of an exercise to demonstrate what you can do with infinitesimal generators. Although, for angular velocity one usually uses a vector whose direction is the axis and length is the rotation speed, as the dynamics equations are easier that way. That's kind of like axis-angle.
Another way to derive the rotation matrix is using quaternions. A quaternion multiplication can be rewritten into a multiplication of a matrix and a quaternion as vector4. And since a point p rotated by quaternion q can be calculated by doing q∙quat(0, p)∙q-1, you can figure out the rotation matrix.
The same infinitesimal math can be applied to quaternions. Generator of quaternion rotation about axis identified by unit vector n is
G = quat(0, n) / 2.
So, for finite angle a, quaternion of rotation equals
q = exp(G*a*) = quat(cos(a / 2), n sin(a / 2)).