I know how to compute the composition of two rotations using quaternions (or by multiplying rotation matrices), and this theorem by Hamilton is very helpful in understanding geometrically how it works.
However, the above is for the case where both rotations are around axes that pass through the origin. I would like to know what happens if this is not the case.
So suppose I take a three dimensional object and rotate it first by an angle of $\theta_1$ around axis $a_1$ and then by an angle of $\theta_2$ around axis $a_2$, where $a_1$ and $a_2$ are oriented lines in 3D space that do not necessarily intersect.
From geometric intuition, it seems that the composition of rotations in 3d will be a rotation by some angle $\theta_3$ around some axis $a_3$, combined with a translation along the axis $a_3$. (Except in degenerate cases where it's just a translation or just a rotation).
I think the angle $\theta_3$ and the orientation of $a_3$ will be calculated in the same way as for the case when the axes pass through the origin. But what about the position of the new axis and the translational component along it? How can this be calculated, and, more importantly, how can I get a good geometric intuition about how it depends on the angles $\theta_1$, $\theta_2$ and the axes $a_1$ and $a_2$ of the original rotations?
The composition of two rotations will not always be a rotation. Thinking first about the Euclidean plane, if we take the rotations by angle $\pi$ in two different centres, then the product of these transformations will be a translation. This is the reason that the set of all rotations of the Euclidean plane is not a group.
Now, we construct a three-dimensional example. Let $R_{1},R_{2}$ be rotations of $\mathbb{E}^{2}$ by angle $\pi$, with different centres $p_{1},p_{2} \in \mathbb{E}^{2}$. Then for $i = 1,2$ the rotations say $\tilde{R}_{i} : \mathbb{E}^{3} \rightarrow \mathbb{E}^{3}$ given by $$(x,y,z) \mapsto (R_{i}(x,y),z) $$ have composition $\tilde{R}_{1} \circ \tilde{R}_{2} $ which is a translation of $\mathbb{E}^{3}$.