\begin{eqnarray*} \begin{bmatrix} x' \\ y' \end{bmatrix} & = & \begin{bmatrix} i_d.x & j_d.x \\ i_d.y & i_d.y \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} + \begin{bmatrix} p_d.x \\ p_d.y \end{bmatrix}\\ i_d.x & = & i_1.x \cdot i_2.x + j_1.x \cdot i_2.y\\ i_d.y & = & i_1.y \cdot i_2.x + j_1.y \cdot i_2.y\\ j_d.x & = & i_1.x \cdot j_2.x + j_1.x \cdot j_2.y\\ j_d.y & = & i_1.y \cdot j_2.x + j_1.y \cdot j_2.y\\ p_d.x & = & i_1.x \cdot p_2.x + j_1.x \cdot p_2.y + p_1.x\\ p_d.y & = & i_1.y \cdot p_2.x + j_1.y \cdot p_2.y + p_1.y\\ \end{eqnarray*}