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.
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.