Using transformations to get from A to B image I try to solve this,



First, I used scaling: $Scale(S_x,S_y)=S(\sqrt 5,\sqrt 5)$

So, I enlarge the bottom of the house and the sides, to the same size of B image.

Later, I used rotation: $R(\theta)=R(cos^{-1}(2/\sqrt 5))$
the vertex that was $[\sqrt 5, 0, 1]$ moved $[2, 1, 1]$ I do that because I thought to translate it to $[5,3,1]$

But I stuck with that.

What is the idea of this question?

Thanks.
Just use linear algebra.

Since parallel lines have remained parallel (i.e. meaning we can probably assume the w component of homogeneous coordinates is always 1), we can just pick 3 starting points and their destinations, e.g.

(0,0,1)-&gt;(3,2,1),  (0,1,1)-&gt;(1,3,1), and  (1,0,1)-&gt;(5,3,1),


define M to be your (homogeneous) transformation matrix as 

$$ M =\begin{bmatrix}
a &amp; b &amp; c \\
d &amp; e &amp; f \\
0 &amp; 0 &amp; 1\\
\end{bmatrix}  $$
and then we have 
$$ M.\begin{bmatrix}
0 &amp; 0 &amp; 1 \\
0 &amp; 1 &amp; 0 \\
1 &amp; 1 &amp; 1\\
\end{bmatrix} = 
\begin{bmatrix}
3 &amp; 1 &amp; 5 \\
2 &amp; 3 &amp; 3 \\
1 &amp; 1 &amp; 1\\
\end{bmatrix}
 $$

You just need to find the inverse of the 'starting point' matrix (which is left as an exercise for the reader ) and rearrange to compute...
$$ M= 
\begin{bmatrix}
3 &amp; 1 &amp; 5 \\
2 &amp; 3 &amp; 3 \\
1 &amp; 1 &amp; 1\\
\end{bmatrix}
.\begin{bmatrix}
0 &amp; 0 &amp; 1 \\
0 &amp; 1 &amp; 0 \\
1 &amp; 1 &amp; 1\\
\end{bmatrix}^{-1}$$

To be really thorough, you could also then check that all the remaining points are transformed correctly by your result.

If you don't want to work through the maths yourself, the resulting matrix is


   $ M= \begin{bmatrix} 2 &amp; -2 &amp; 3 \\ 1 &amp; 1 &amp; 2 \\ 0 &amp; 0 &amp; 1\\ \end{bmatrix}$