# Translation, Scaling and Rotation of Matrix

Two 2D house models A and B are shown in the figure below. House A has one point at (3,2) and House B has one point at (0,-1).

Calculate a chain of matrices that, when post-multiplied by the vertices of House A, will transform all the vertices of House A into the vertices of House B, i.e. translate and rotate the house point (3,2) to (0,-1). The transformation must also scale the size of House A by half to House B.

My Attempt

First we need to move House A to the origin so we use the translation matrix.

$$\begin{matrix} 1 & 0 & -3 \\ 0 & 1 & -2 \\ 0 & 0 & 1 \\ \end{matrix}$$

Then we have to scale it down by half as per the requirement in the question.

$$\begin{matrix} 1/2 & 0 & 0 \\ 0 & 1/2 & 0 \\ 0 & 0 & 1 \\ \end{matrix}$$

Then I rotate it clockwise

$$\begin{matrix} 0 & 1 & 0 \\ -1 & 0 & 0 \\ 0 & 0 & 1 \\ \end{matrix}$$

Then I translate it from the origin to the House B

$$\begin{matrix} 1 & 0 & 0 \\ 0 & 1 & -1 \\ 0 & 0 & 1 \\ \end{matrix}$$

Finally I multiply all of these matrices together with our original matrix

$$\begin{matrix} 3 \\ 2 \\ 1 \\ \end{matrix}$$

The only problem is, I don't get (0,-1). Instead I get (1,-1.5) which leads me to believe I have done something wrong. I have used a matrix calculator so I know my math is correct so one or more of my matrices are wrong.

In the homogeneous coordinates that you wrote the matrices for, the tip of House A is represented by $(3,2,1)$, not $(3,2,0)$. If you use that, you get $(0,-1,1)$ as expected.
• @Aceboy1993: The first multiplication yields $(0,0,1)$, and that remains invariant until the last multiplication transforms it into $(0,-1,1)$. – joriki May 6 '16 at 18:04