Skip to content

Chapter 41. Shears and Scalings

Shears and scalings are elementary linear transformations. They change the shape or size of vectors while keeping the origin fixed. Both are represented by simple matrices, and both are used as building blocks for more complicated transformations.

A scaling transformation multiplies selected directions by scalar factors. A shear transformation slides one coordinate direction parallel to another. In two dimensions, common shear matrices have the forms

[1k01] \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix}

and

[10k1]. \begin{bmatrix} 1 & 0\\ k & 1 \end{bmatrix}.

These send (x,y)(x,y) to (x+ky,y)(x+ky,y) and (x,y+kx)(x,y+kx), respectively. Scaling, shearing, rotation, reflection, and projection are standard examples of linear transformations represented by matrices.

41.1 Scaling Transformations

A scaling transformation multiplies coordinates by fixed numbers.

In R2\mathbb{R}^2, define

S[xy]=[axby]. S \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} ax\\ by \end{bmatrix}.

The matrix of this transformation is

S=[a00b]. S= \begin{bmatrix} a & 0\\ 0 & b \end{bmatrix}.

The scalar aa scales the xx-direction, and the scalar bb scales the yy-direction.

If

a=b, a=b,

then the scaling is uniform. All directions are stretched or compressed by the same factor.

If

ab, a\neq b,

then the scaling is nonuniform. Different coordinate directions are scaled by different factors.

41.2 Uniform Scaling

A uniform scaling in Rn\mathbb{R}^n has the form

S=λI. S=\lambda I.

It sends every vector vv to

S(v)=λv. S(v)=\lambda v.

If

λ>1, \lambda>1,

the transformation stretches space away from the origin.

If

0<λ<1, 0<\lambda<1,

the transformation compresses space toward the origin.

If

λ=1, \lambda=-1,

the transformation sends each vector to its negative:

vv. v\mapsto -v.

If

λ=0, \lambda=0,

the transformation collapses the whole space to the zero vector.

Uniform scaling preserves directions. It changes lengths by the factor λ|\lambda|. When λ\lambda is negative, it also reverses each line through the origin.

41.3 Nonuniform Scaling

A nonuniform scaling in Rn\mathbb{R}^n is represented by a diagonal matrix

S=[s1000s2000sn]. S= \begin{bmatrix} s_1 & 0 & \cdots & 0\\ 0 & s_2 & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & \cdots & s_n \end{bmatrix}.

It sends

[x1x2xn] \begin{bmatrix} x_1\\ x_2\\ \vdots\\ x_n \end{bmatrix}

to

[s1x1s2x2snxn]. \begin{bmatrix} s_1x_1\\ s_2x_2\\ \vdots\\ s_nx_n \end{bmatrix}.

Each coordinate axis is scaled independently.

In R3\mathbb{R}^3, the matrix

[200030001] \begin{bmatrix} 2 & 0 & 0\\ 0 & 3 & 0\\ 0 & 0 & 1 \end{bmatrix}

doubles the xx-coordinate, triples the yy-coordinate, and leaves the zz-coordinate unchanged.

Scaling matrices in three dimensions commonly use one scale factor for each coordinate axis.

41.4 Scaling and Determinant

The determinant of a diagonal scaling matrix is the product of its scale factors.

For

S=[s1000s2000sn], S= \begin{bmatrix} s_1 & 0 & \cdots & 0\\ 0 & s_2 & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & \cdots & s_n \end{bmatrix},

we have

det(S)=s1s2sn. \det(S)=s_1s_2\cdots s_n.

This product measures the signed volume scaling factor.

In R2\mathbb{R}^2, the matrix

[a00b] \begin{bmatrix} a & 0\\ 0 & b \end{bmatrix}

scales area by

ab. ab.

In R3\mathbb{R}^3, the matrix

[a000b000c] \begin{bmatrix} a & 0 & 0\\ 0 & b & 0\\ 0 & 0 & c \end{bmatrix}

scales volume by

abc. abc.

If the determinant is zero, at least one scale factor is zero, and the transformation collapses space into a lower-dimensional subspace.

41.5 Invertibility of Scalings

A scaling transformation is invertible exactly when none of its scale factors is zero.

For

S=[s1000s2000sn], S= \begin{bmatrix} s_1 & 0 & \cdots & 0\\ 0 & s_2 & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & \cdots & s_n \end{bmatrix},

the inverse exists if and only if

si0 s_i\neq 0

for every ii. In that case,

S1=[1/s10001/s20001/sn]. S^{-1}= \begin{bmatrix} 1/s_1 & 0 & \cdots & 0\\ 0 & 1/s_2 & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & \cdots & 1/s_n \end{bmatrix}.

The inverse undoes each coordinate scaling.

For example,

[2005]1=[1/2001/5]. \begin{bmatrix} 2 & 0\\ 0 & 5 \end{bmatrix}^{-1} = \begin{bmatrix} 1/2 & 0\\ 0 & 1/5 \end{bmatrix}.

41.6 Eigenvalues of a Scaling

A diagonal scaling matrix has the coordinate axes as eigenspaces.

Let

S=[s100s2]. S= \begin{bmatrix} s_1 & 0\\ 0 & s_2 \end{bmatrix}.

Then

S[10]=s1[10], S \begin{bmatrix} 1\\ 0 \end{bmatrix} = s_1 \begin{bmatrix} 1\\ 0 \end{bmatrix},

and

S[01]=s2[01]. S \begin{bmatrix} 0\\ 1 \end{bmatrix} = s_2 \begin{bmatrix} 0\\ 1 \end{bmatrix}.

Thus the coordinate axes are invariant directions. The eigenvalues are the scale factors.

In Rn\mathbb{R}^n, the standard basis vector eie_i is an eigenvector with eigenvalue sis_i:

Sei=siei. Se_i=s_i e_i.

Scaling transformations are therefore among the simplest diagonalizable operators.

41.7 Shear Transformations

A shear transformation slides one coordinate direction parallel to another while preserving certain parallel lines.

In R2\mathbb{R}^2, a shear parallel to the xx-axis has the form

Hx[xy]=[x+kyy]. H_x \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} x+ky\\ y \end{bmatrix}.

Its matrix is

Hx=[1k01]. H_x= \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix}.

The yy-coordinate is unchanged. The xx-coordinate is shifted by an amount proportional to yy.

A shear parallel to the yy-axis has the form

Hy[xy]=[xy+kx], H_y \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} x\\ y+kx \end{bmatrix},

with matrix

Hy=[10k1]. H_y= \begin{bmatrix} 1 & 0\\ k & 1 \end{bmatrix}.

These are the standard coordinate shear matrices in two dimensions.

41.8 Geometry of an xx-Shear

Consider

Hx=[1k01]. H_x= \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix}.

It sends

[xy] \begin{bmatrix} x\\ y \end{bmatrix}

to

[x+kyy]. \begin{bmatrix} x+ky\\ y \end{bmatrix}.

Points on the xx-axis have y=0y=0, so

Hx[x0]=[x0]. H_x \begin{bmatrix} x\\ 0 \end{bmatrix} = \begin{bmatrix} x\\ 0 \end{bmatrix}.

Thus the xx-axis is fixed pointwise.

Horizontal lines are preserved as horizontal lines because yy is unchanged. A point farther from the xx-axis is shifted more in the xx-direction.

The unit square with vertices

(0,0),(1,0),(0,1),(1,1) (0,0),\quad (1,0),\quad (0,1),\quad (1,1)

is sent to the parallelogram with vertices

(0,0),(1,0),(k,1),(1+k,1). (0,0),\quad (1,0),\quad (k,1),\quad (1+k,1).

Thus a shear changes right angles, but keeps area in this case.

41.9 Determinant of a Shear

The determinant of

Hx=[1k01] H_x= \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix}

is

det(Hx)=110k=1. \det(H_x)=1\cdot 1-0\cdot k=1.

Similarly,

det[10k1]=1. \det \begin{bmatrix} 1 & 0\\ k & 1 \end{bmatrix} =1.

Thus these shears preserve signed area.

In higher dimensions, elementary shear matrices have determinant 11. They change shape, but they do not change volume.

This distinguishes shears from general scalings. A nonuniform scaling may change volume, while a basic shear preserves volume.

41.10 Invertibility of Shears

A shear matrix is invertible.

For

Hx=[1k01], H_x= \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix},

the inverse is

Hx1=[1k01]. H_x^{-1}= \begin{bmatrix} 1 & -k\\ 0 & 1 \end{bmatrix}.

Indeed,

[1k01][1k01]=[1001]. \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & -k\\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix}.

The inverse shear slides in the opposite direction.

Similarly,

[10k1]1=[10k1]. \begin{bmatrix} 1 & 0\\ k & 1 \end{bmatrix}^{-1} = \begin{bmatrix} 1 & 0\\ -k & 1 \end{bmatrix}.

Thus a shear distorts shape without losing information.

41.11 Eigenvalues of a Shear

The matrix

Hx=[1k01] H_x= \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix}

has characteristic polynomial

det(HxλI)=det[1λk01λ]=(1λ)2. \det(H_x-\lambda I) = \det \begin{bmatrix} 1-\lambda & k\\ 0 & 1-\lambda \end{bmatrix} = (1-\lambda)^2.

Thus the only eigenvalue is

λ=1. \lambda=1.

If k0k\neq 0, the eigenspace is found by solving

(HxI)v=0. (H_x-I)v=0.

Now

HxI=[0k00]. H_x-I= \begin{bmatrix} 0 & k\\ 0 & 0 \end{bmatrix}.

So

ky=0. ky=0.

Since k0k\neq 0,

y=0. y=0.

Therefore the eigenspace is the xx-axis:

span{[10]}. \operatorname{span} \left\{ \begin{bmatrix} 1\\ 0 \end{bmatrix} \right\}.

A nontrivial shear in R2\mathbb{R}^2 has only one eigendirection, even though the algebraic multiplicity of the eigenvalue 11 is two.

41.12 Shears and Diagonalization

A nontrivial shear is not diagonalizable over R\mathbb{R}.

For

Hx=[1k01],k0, H_x= \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix}, \qquad k\neq 0,

the only eigenvalue is 11, and the eigenspace is one-dimensional. A 2×22\times 2 matrix is diagonalizable only if it has a basis of eigenvectors. Here there is only one independent eigenvector.

Thus HxH_x cannot be diagonalized.

It can be written as

Hx=I+N, H_x=I+N,

where

N=[0k00]. N= \begin{bmatrix} 0 & k\\ 0 & 0 \end{bmatrix}.

The matrix NN is nilpotent because

N2=0. N^2=0.

Therefore a shear is a simple example of a matrix with a nilpotent part.

41.13 Powers of a Shear

Let

H=I+N, H=I+N,

where

N2=0. N^2=0.

Then

Hm=(I+N)m=I+mN H^m=(I+N)^m=I+mN

for every integer m0m\geq 0.

For the shear

Hx=[1k01], H_x= \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix},

this gives

Hxm=[1mk01]. H_x^m= \begin{bmatrix} 1 & mk\\ 0 & 1 \end{bmatrix}.

Repeated shearing adds the shear amount. Applying the same shear twice gives twice the horizontal displacement for each value of yy.

The inverse powers are

Hxm=[1mk01]. H_x^{-m}= \begin{bmatrix} 1 & -mk\\ 0 & 1 \end{bmatrix}.

41.14 Elementary Shears in Higher Dimensions

In Rn\mathbb{R}^n, an elementary shear adds a multiple of one coordinate to another.

For example, in R3\mathbb{R}^3,

H[xyz]=[x+kyyz] H \begin{bmatrix} x\\ y\\ z \end{bmatrix} = \begin{bmatrix} x+ky\\ y\\ z \end{bmatrix}

has matrix

H=[1k0010001]. H= \begin{bmatrix} 1 & k & 0\\ 0 & 1 & 0\\ 0 & 0 & 1 \end{bmatrix}.

More generally, an elementary shear has identity entries on the diagonal and a single off-diagonal entry kk. It has determinant 11 and is invertible. Its inverse is obtained by replacing kk with k-k.

Elementary shears are closely related to elementary row operations and elementary matrices.

41.15 Shears and Elementary Matrices

Adding a multiple of one row to another is an elementary row operation. The corresponding elementary matrix is a shear matrix.

For example, left multiplication by

E=[100k10001] E= \begin{bmatrix} 1 & 0 & 0\\ k & 1 & 0\\ 0 & 0 & 1 \end{bmatrix}

adds kk times row 11 to row 22.

This matrix is a shear in coordinate space. It is invertible, and

E1=[100k10001]. E^{-1}= \begin{bmatrix} 1 & 0 & 0\\ -k & 1 & 0\\ 0 & 0 & 1 \end{bmatrix}.

Thus the row operation can be undone.

This connection explains why shears appear implicitly in Gaussian elimination. Elimination uses elementary invertible transformations, many of which are shear operations.

41.16 Scaling and Elementary Matrices

Multiplying a row by a nonzero scalar is another elementary row operation.

The corresponding elementary matrix is a scaling matrix. For example,

D=[1000c0001] D= \begin{bmatrix} 1 & 0 & 0\\ 0 & c & 0\\ 0 & 0 & 1 \end{bmatrix}

multiplies row 22 by cc.

It is invertible exactly when

c0. c\neq 0.

Its inverse is

D1=[10001/c0001]. D^{-1}= \begin{bmatrix} 1 & 0 & 0\\ 0 & 1/c & 0\\ 0 & 0 & 1 \end{bmatrix}.

Thus the basic operations in row reduction include scalings and shears.

41.17 Shears as Volume-Preserving Transformations

A shear changes shape but preserves volume.

In R2\mathbb{R}^2, an xx-shear sends a square to a parallelogram with the same base and height. Hence the area is unchanged.

Algebraically, this is because the determinant is 11.

In Rn\mathbb{R}^n, an elementary shear has determinant 11, so it preserves signed nn-dimensional volume.

This property is useful in geometry, mechanics, numerical methods, and matrix factorization. Shears are examples of transformations that may substantially alter angles while preserving volume.

41.18 Scaling as Volume Change

Scaling gives the simplest examples of controlled volume change.

A uniform scaling

S=λI S=\lambda I

in Rn\mathbb{R}^n has determinant

det(S)=λn. \det(S)=\lambda^n.

Thus lengths are multiplied by λ|\lambda|, areas by λ2|\lambda|^2, and nn-dimensional volumes by λn|\lambda|^n.

A nonuniform scaling

S=diag(s1,,sn) S=\operatorname{diag}(s_1,\ldots,s_n)

has determinant

s1s2sn. s_1s_2\cdots s_n.

The determinant records the total signed volume change, even when different directions are scaled differently.

41.19 Composition of Shears and Scalings

Shears and scalings can be composed to produce more complex transformations.

For example,

H=[1k01],S=[a00b]. H= \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix}, \qquad S= \begin{bmatrix} a & 0\\ 0 & b \end{bmatrix}.

Then

HS=[1k01][a00b]=[akb0b]. HS= \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix} \begin{bmatrix} a & 0\\ 0 & b \end{bmatrix} = \begin{bmatrix} a & kb\\ 0 & b \end{bmatrix}.

But

SH=[a00b][1k01]=[aak0b]. SH= \begin{bmatrix} a & 0\\ 0 & b \end{bmatrix} \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix} = \begin{bmatrix} a & ak\\ 0 & b \end{bmatrix}.

In general,

HSSH. HS\neq SH.

Thus applying a shear before a scaling may differ from applying the scaling before the shear.

41.20 Shears, Scalings, and Bases

A scaling is diagonal in a basis of directions that it independently stretches.

A shear usually cannot be diagonalized, but it has a simple form in a suitable basis. It fixes one subspace and shifts vectors parallel to that subspace by an amount controlled by another coordinate.

In matrix factorization, many matrices can be reduced or decomposed using elementary operations that correspond to shears, scalings, and swaps. These elementary transformations give a constructive view of invertible matrices.

For instance, Gaussian elimination factors a matrix into products of elementary matrices. The elementary matrices include shear matrices for row addition and scaling matrices for row rescaling.

41.21 Relation to Affine Transformations

Shears and scalings discussed here are linear because they fix the origin.

A translation

xx+b x\mapsto x+b

with b0b\neq 0 is not linear because it sends

0 0

to

b. b.

In computer graphics and geometry, translations are often combined with linear transformations using homogeneous coordinates. In ordinary vector-space coordinates, however, pure translations are affine, not linear.

Shears and scalings become part of larger affine transformation systems when translation is added.

41.22 Summary

A scaling transformation multiplies directions by scalar factors. In coordinates, it is represented by a diagonal matrix

S=diag(s1,,sn). S=\operatorname{diag}(s_1,\ldots,s_n).

It is invertible exactly when all scale factors are nonzero. Its determinant is

s1s2sn, s_1s_2\cdots s_n,

which gives the signed volume scaling factor.

A shear transformation adds a multiple of one coordinate to another. In R2\mathbb{R}^2, standard shear matrices are

[1k01] \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix}

and

[10k1]. \begin{bmatrix} 1 & 0\\ k & 1 \end{bmatrix}.

A nontrivial shear is invertible, has determinant 11, preserves area or volume, and is generally not diagonalizable.

Scalings change size directly. Shears change shape by sliding one direction along another. Together they form basic building blocks for matrix transformations, elimination, geometric modeling, and matrix factorizations.