Simple Affine Stretch of Triangle

affine-geometrylinear algebra

I am having a little trouble with the following problem:

Use explicit affine transformation, i.e., written down in matrix form, to stretch triangle having vertices $(\frac{1}{2},0), (\frac{1}{2},\frac{1}{2}),(1,0)$ to cover triangle with vertices $(\frac{1}{2},1),(0,0),(1,0)$.

Intuitively, we have a simple right triangle sitting in the plane. What we need to do is to stretch to cover the second one, which looks like we have adjoined the copy of initial one to form isosceles triangle.
I am stuck on writing down explicitly what this transformation looks like. Any help is appreciated.

Best Answer

Since you’re being asked to represent an affine transformation as a single matrix, I presume that you’re familiar with homogeneous coordinates. So, you’re looking for a matrix of the form $$M=\begin{bmatrix}a_{11}&a_{12}&t_{1} \\ a_{21} & a_{22} & t_2 \\ 0&0&1\end{bmatrix}$$ such that $$M\left(\frac12,0,1\right)^T = \left(\frac12,1,1\right)^T \\ M\left(\frac12,\frac12,1\right)T = (0,0,1)^T \\ M(1,0,1)^T = (1,0,1)^T.$$ If you multiply these out, you will have a system of linear equations in the unknown entries of $M$ to solve.

On the other hand, if you package the three conditions up as a single matrix equation, you can derive an expression for $M$ as the product of two matrices. We have $$M \begin{bmatrix}\frac12&\frac12&1 \\ 0&\frac12&0 \\ 1&1&1\end{bmatrix} = \begin{bmatrix} \frac12&0&1 \\ 1&0&0 \\ 1&1&1 \end{bmatrix}$$ and since the matrix on the left-hand side is nonsingular (the triangle isn’t degenerate, so the homogeneous coordinates of its vertices are linearly independent), $$M = \begin{bmatrix}\frac12&0&1\\1&0&0\\1&1&1\end{bmatrix} \begin{bmatrix}\frac12&\frac12&1\\0&\frac12&0\\1&1&1\end{bmatrix}^{-1}.$$ Recall that the columns of a transformation matrix are the images of the basis vectors. Geometrically, then, the right-hand matrix maps the vertices of the first triangle to $(1,0)$, $(0,1)$ and $(0,0)$, respectively, and the left-hand matrix maps these points to the second triangle’s vertices.

Using your observation that the two triangles are isosceles and equal sides of each one are paired, you might instead try to compose the transformation out of more basic ones. There’s probably going to be a rotation and a scaling, together with a translation or two so that everything lines up correctly. Note, however, that there’s also an orientation change: the first triangle’s vertices are traversed clockwise, but the second one’s are traversed counterclockwise, so you’ll need to throw in a reflection as well. Here’s one possible sequence:

  1. Translate by $(-1,0)$
  2. Reflect in the $x$-axis
  3. Rotate clockwise by 45°
  4. Scale $x$ by $\sqrt2$ and $y$ by $2\sqrt2$
  5. Translate by $(1,0)$.

You can either multiply the five matrices that represent these simpler transformations together, or work in coordinates, applying the formula for each transformation in turn, then extracting the elements of the composite matrix after simplifying the resulting expressions.