Combining Two 3D Rotations

The concentric rotations and can be combined either by doing first and then , written as , or first and then , written as . This right-to-left notation comes from the algebra of dot products, and , where is a vector and and are the matrices representing the rotations and .

In general, .

You can vary the axes of rotation by changing the spherical coordinates of their corresponding vectors.