I have two triangles with these corner points:
$$
A=
\left[ {\begin{array}{cc}
0 & -0.5 & 1\\
0 & 0.5 & 1\\
\end{array} } \right]
$$
$$
B=
\left[ {\begin{array}{cc}
1.5 & 2 & 2.5\\
0.5 & 1 & -0.5\\
\end{array} } \right]
$$
They look like this when plotted.
I have to transform triangle B to triangle A.
I did this by:
- $T_1$ = Translating B to the origin.
- $R_1$ = Rotating B 90 degree counter clockwise.
- $T_2$ = Translate B to the same coordinates as A.
Now I want to combine all these operations into one matrix S however I am not sure how this can be done. Is it just S = $T_1 * R_1 * T_2$?
$$ T_1= \left[ {\begin{array}{cc} 1 & 0 & -2\\ 0 & 1 & 0\\ 0 & 0 & 1\\ \end{array} } \right] $$
$$ R_1= \left[ {\begin{array}{cc} 0 & -1 & 0\\ 1 & 0 & 0\\ 0 & 0 & 1\\ \end{array} } \right] $$
$$ T_2= \left[ {\begin{array}{cc} 1 & 0 & 1\\ 0 & 1 & 0.5\\ 0 & 0 & 1\\ \end{array} } \right] $$
$$ S_1 = T_1 * R_1= \left[ {\begin{array}{cc} 0 & -1 & 0\\ 1 & 0 & 0\\ 0 & 0 & 0\\ \end{array} } \right] $$
$$ S = S_1 * T_2= \left[ {\begin{array}{cc} 0 & 0 & -1\\ 1 & 0 & 1\\ 0 & 0 & 0\\ \end{array} } \right] $$
but then
$$ A = S * B= \left[ {\begin{array}{cc} -1 & -1 & -1\\ 2.5 & 3 & 3.5\\ 0 & 0 & 0\\ \end{array} } \right] $$
is wrong.