How to transform arbitrary rectangle into specific parallelogram? I have a rectangle $S$ in $(u,v)$ coordinates. $S = [a,b] \times [c,d]$. 
I want to find the transformation that yields a parallelogram given by $(0,0),(-2,1),(2,4),(4,3)$. I have deduced this is equivalent to 
$$\bigg\lbrace (x,y) \bigg | \text{area bounded by } y = -\frac{1}{2}x, y = \frac{3}{4} x ,y = \frac{3}{4} x + \frac{5}{2}, y = -\frac{1}{2}x + 5\bigg\rbrace$$
I'm sure I'm doing this the hard way. But my intinct was there are four steps to do it. 


*

*Translate the rectangle to the origin

*Resize the edges 

*Shear it

*Rotate it


So if 
$$\begin{bmatrix} 
u \\ v \\
\end{bmatrix} \in S$$
Translation: 
$$T = \begin{bmatrix} 
-a \\ -c \\
\end{bmatrix}$$
Rescale:
$$A_1 = \begin{bmatrix} 
\frac{\gamma}{b-a} & 0 \\
& \frac{5}{d-c}
\end{bmatrix}$$
Shear: 
$$A_2 = \begin{bmatrix} 
1 & -\frac{1}{2} \\
0 & 1
\end{bmatrix}$$
Rotation: 
$$R = \begin{bmatrix} 
4/5 & -3/5 \\
3/5 & 4/5
\end{bmatrix}$$
So then the transformation would look like
$$ \begin{bmatrix} 
x \\ y \\
\end{bmatrix} = RA_2A_1\bigg(\begin{bmatrix} 
u \\ v \\
\end{bmatrix} +T\bigg)$$
However, I can't figure out what $\gamma$ should be for the rescaling. Can anyone help? 

After trial and error, I found that 
Translation: 
$$T = \begin{bmatrix} 
-a \\ -c \\
\end{bmatrix}$$
Rescale:
$$A_1 = \begin{bmatrix} 
\frac{5}{b-a} & 0 \\
& \frac{2}{d-c}
\end{bmatrix}$$
Shear: 
$$A_2 = \begin{bmatrix} 
1 & -\frac{1}{2} \\
0 & 1
\end{bmatrix}$$
Rotation: 
$$R = \begin{bmatrix} 
4/5 & -3/5 \\
3/5 & 4/5
\end{bmatrix}$$
Example 
$S = [10,20] \times [0,2]$ and suppose we consider the point $ \begin{bmatrix} 
20 \\ 2 \\
\end{bmatrix}$
$$\begin{bmatrix} 
2 \\ 4 \\
\end{bmatrix} = R A_2 A_1 \bigg ( \begin{bmatrix} 
20 \\ 2 \\
\end{bmatrix} + \begin{bmatrix} 
-10 \\ 0 \\
\end{bmatrix}\bigg )$$
