Mathwords logoMathwords

Shear Matrix — Definition, Formula & Examples

A shear matrix is a square matrix that, when multiplied by a vector, shifts one component of that vector by an amount proportional to another component. It 'slants' shapes without changing their area.

A shear matrix is an elementary matrix obtained from the identity matrix by adding a nonzero off-diagonal entry kk in position (i,j)(i, j) where iji \neq j. It represents a linear map that fixes all basis vectors except that the image of ej\mathbf{e}_j gains a component keik\mathbf{e}_i. The determinant of every shear matrix equals 1, so the transformation is volume-preserving.

Key Formula

S=(1k01)S = \begin{pmatrix} 1 & k \\ 0 & 1 \end{pmatrix}
Where:
  • kk = Shear factor — determines how much the x-component is displaced per unit of y
  • SS = The 2D horizontal shear matrix (shears parallel to the x-axis)

How It Works

To build a 2D shear matrix, start with the 2×22 \times 2 identity matrix and place the shear factor kk in the off-diagonal position corresponding to the direction you want to displace. A horizontal shear uses position (1,2)(1,2), shifting the xx-component based on yy. A vertical shear uses position (2,1)(2,1), shifting yy based on xx. When you multiply the shear matrix by a column vector, the targeted component changes while the other stays fixed. In higher dimensions, the same idea applies: place kk at row ii, column jj to shear the ii-th coordinate proportionally to the jj-th.

Worked Example

Problem: Apply a horizontal shear with factor k = 2 to the point (3, 1).
Step 1: Write the shear matrix with k = 2 in position (1,2).
S=(1201)S = \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}
Step 2: Multiply the shear matrix by the column vector.
S(31)=(13+2103+11)=(51)S\begin{pmatrix} 3 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \cdot 3 + 2 \cdot 1 \\ 0 \cdot 3 + 1 \cdot 1 \end{pmatrix} = \begin{pmatrix} 5 \\ 1 \end{pmatrix}
Answer: The sheared point is (5, 1). The x-component shifted by 2·1 = 2, while the y-component stayed at 1.

Why It Matters

Shear matrices appear in LU decomposition, where Gaussian elimination steps are encoded as shear (elementary) matrices. In computer graphics, shearing is a basic affine operation used to skew images and derive oblique projections. Understanding shear also clarifies why row operations preserve determinant sign and magnitude.

Common Mistakes

Mistake: Placing the shear factor on the diagonal instead of off-diagonal.
Correction: The diagonal entries of a shear matrix are all 1. The shear factor k goes in an off-diagonal position (i, j) with i ≠ j. Changing the diagonal would introduce scaling, not shearing.