[Math] General form of a shear map

geometrylinear algebralinear-transformationsmatrices

From Wikipedia

In plane geometry, a shear mapping is a linear map that displaces each point in fixed direction, by an amount proportional to its signed distance from a line that is parallel to that direction.

I'm interested in the matrix representation of a general shear map in the plane. Every resource I look at either only gives the horizontal and vertical shear matrices $$\begin{bmatrix} 1 & k \\ 0 & 1\end{bmatrix} \quad\text{and}\quad \begin{bmatrix} 1 & 0 \\ k & 1\end{bmatrix}$$ or a couple have said that $$\begin{bmatrix} 1 & a \\ b & 1\end{bmatrix}$$ is also a shear map. However I don't think that last one is if neither $a$ nor $b$ is zero because, as far as I understand, shear mappings should be area preserving.

So then what is the general form of the matrix representing a shear map that displaces all vectors in the direction parallel to an arbitrary vector $(x,y)$?

Best Answer

Lets say generalized sheer takes the vector $\begin{bmatrix} x\\y\end{bmatrix}$ to $\begin{bmatrix} x\\y\end{bmatrix}$ and the orthogonal vector,

$\begin{bmatrix} -y\\x\end{bmatrix}$ to $\begin{bmatrix} -y + kx\\x + ky\end{bmatrix}$

in term of the basis$\left\{\begin{bmatrix} x\\y\end{bmatrix},\begin{bmatrix} -y\\x\end{bmatrix}\right\}$ our transformation is $T = \begin{bmatrix} 1&k\\0&1 \end{bmatrix}$

And in terms of the standard basis

$\begin{bmatrix} 1 -\frac {kxy}{x^2+y^2} & \frac {kx^2}{x^2+y^2}\\-\frac {ky^2}{x^2+y^2}&1+\frac{kxy}{x^2+y^2}\end{bmatrix}$