# Is it possible to combine two sequential rotations about different points into one rotation about a point?

I need to perform two sequential rotations, about different points, by different angles.

Call the initial point $$A$$, and the final solution after the two rotations $$A'$$.

Call the two centers of rotation $$C_1$$ and $$C_2$$.

Call the two angles $$\theta_1$$ and $$\theta_2$$.

Is there a way to calculate a new center of rotation $$C_3$$ and angle $$\theta_3$$ that will rotate $$A$$ to $$A'$$ in one operation?

I know I can perform the operations sequentially using translation and rotation matrices, but I have to perform these calculations many, many times, using the same $$C_1$$, $$C_2$$, $$\theta_1$$ and $$\theta_2$$, so it would roughly cut my time in half if I could find $$C_3$$ and $$\theta_3$$ first.

EDIT:

I've just realized that $$C_3$$ and $$\theta_3$$ will be dependent on the specific starting point, thus I'd have to re-calculate $$C_3$$ and $$\theta_3$$ for every point I want to do the rotations on, and the extra calculations may mean that there is no benefit to doing this over just doing the sequential matrix calculations... Anyway, if anyone knows any shortcuts, given my question above, please let me know. Thanks.

• IN which dimension do you consider the problem? Is it on $\mathbb R^2$ oder $\mathbb R^n$ for $n\geq 3$? – Mundron Schmidt Jan 30 at 18:06

Use homogeneous coordinates, then you get 4x4 matrices combining rotation and translation: $$M = R_2TR_1$$ Where $$R_1, R_2$$ are your rotation matrices and $$T$$ is your translation matrix. The rotation matrices are the usual rotation matrices apart from the last column and row (4x4) which have $$0$$ everywhere except at $$a_{4,4}$$. The translation matrix is the 4x4 identity with the last column being the translation $$(a_{1,1}, a_{2,1}, a_{3,1})$$. Multiplying the matrices will yield the matrix $$M$$ which has the rotation you need in the 3x3 part and the translation in the last column. Your vector should be extended to a $$4D$$ vector with $$1$$ as last element before multiplying. If your case is $$2D$$ then it's similar just with 2x2 rotation part, and last column with 2 translation elements.

In your case, the result of doing both rotations (assuming the angles $$\theta_1,\theta_2$$ have a sign respective to a chosen orientation, and setting $$\theta_3 = \theta_1+\theta_2$$) will be

a) a rotation about a point $$C_3$$ with the angle $$\theta_3$$, if $$\theta_3 \neq 0°$$

b) a translation if $$\theta_3 = 0°$$

Unlike your EDIT says, this is true for all starting points $$A$$, that means $$C_3$$ is always the same in case a).

In order to find out how best to do it, I'd suggest going the route of matrices, as you indicated in the posting.

Each rotation $$R$$ can be described as $$R(x) = Mx+b$$, where $$x$$ is the original point, $$R(x)$$ is the image of $$x$$ under $$R$$. $$M$$ is the rotation matrix and $$b$$ a translational part that comes from the fact that you don't usually rotate around the origin. You can get $$b$$ easily when you consider another form of the transformation

$$R(x)=M(x-c)+c$$

where $$c$$ are the coordinates of the center of rotation ($$C_1,C_2$$ in this case).

We can combine the 2 rotations $$R_1, R_2$$ now:

$$R_2(R_1(x))=M_2(M_1x+b_1)+b_2 = (M_2M_1)x + (M_2b_1+b_2)$$

Once you have calculated $$M_1,b_1,M_2,b_2$$ you can use the above formula to calculate $$M_{1+2}=M_2M_1$$ and $$b_{1+2}=M_2b_1+b_2$$. You can then use those values to calculate the image $$A'$$ as

$$a'=M_{1+2}a+b_{1+2}$$

The good thing about all of this is that you don't need to treat the cases a) and b) differently: $$M_3$$ will be rotation matrix in case a) and the identity matrix in case b).