# Chapter 41. Shears and Scalings

# 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

$$
\begin{bmatrix}
1 & k\\
0 & 1
\end{bmatrix}
$$

and

$$
\begin{bmatrix}
1 & 0\\
k & 1
\end{bmatrix}.
$$

These send \((x,y)\) to \((x+ky,y)\) and \((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 \(\mathbb{R}^2\), define

$$
S
\begin{bmatrix}
x\\
y
\end{bmatrix} =
\begin{bmatrix}
ax\\
by
\end{bmatrix}.
$$

The matrix of this transformation is

$$
S=
\begin{bmatrix}
a & 0\\
0 & b
\end{bmatrix}.
$$

The scalar \(a\) scales the \(x\)-direction, and the scalar \(b\) scales the \(y\)-direction.

If

$$
a=b,
$$

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

If

$$
a\neq b,
$$

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

## 41.2 Uniform Scaling

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

$$
S=\lambda I.
$$

It sends every vector \(v\) to

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

If

$$
\lambda>1,
$$

the transformation stretches space away from the origin.

If

$$
0<\lambda<1,
$$

the transformation compresses space toward the origin.

If

$$
\lambda=-1,
$$

the transformation sends each vector to its negative:

$$
v\mapsto -v.
$$

If

$$
\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 \(\mathbb{R}^n\) is represented by a diagonal matrix

$$
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

$$
\begin{bmatrix}
x_1\\
x_2\\
\vdots\\
x_n
\end{bmatrix}
$$

to

$$
\begin{bmatrix}
s_1x_1\\
s_2x_2\\
\vdots\\
s_nx_n
\end{bmatrix}.
$$

Each coordinate axis is scaled independently.

In \(\mathbb{R}^3\), the matrix

$$
\begin{bmatrix}
2 & 0 & 0\\
0 & 3 & 0\\
0 & 0 & 1
\end{bmatrix}
$$

doubles the \(x\)-coordinate, triples the \(y\)-coordinate, and leaves the \(z\)-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=
\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)=s_1s_2\cdots s_n.
$$

This product measures the signed volume scaling factor.

In \(\mathbb{R}^2\), the matrix

$$
\begin{bmatrix}
a & 0\\
0 & b
\end{bmatrix}
$$

scales area by

$$
ab.
$$

In \(\mathbb{R}^3\), the matrix

$$
\begin{bmatrix}
a & 0 & 0\\
0 & b & 0\\
0 & 0 & c
\end{bmatrix}
$$

scales volume by

$$
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=
\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

$$
s_i\neq 0
$$

for every \(i\). In that case,

$$
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,

$$
\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=
\begin{bmatrix}
s_1 & 0\\
0 & s_2
\end{bmatrix}.
$$

Then

$$
S
\begin{bmatrix}
1\\
0
\end{bmatrix} =
s_1
\begin{bmatrix}
1\\
0
\end{bmatrix},
$$

and

$$
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 \(\mathbb{R}^n\), the standard basis vector \(e_i\) is an eigenvector with eigenvalue \(s_i\):

$$
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 \(\mathbb{R}^2\), a shear parallel to the \(x\)-axis has the form

$$
H_x
\begin{bmatrix}
x\\
y
\end{bmatrix} =
\begin{bmatrix}
x+ky\\
y
\end{bmatrix}.
$$

Its matrix is

$$
H_x=
\begin{bmatrix}
1 & k\\
0 & 1
\end{bmatrix}.
$$

The \(y\)-coordinate is unchanged. The \(x\)-coordinate is shifted by an amount proportional to \(y\).

A shear parallel to the \(y\)-axis has the form

$$
H_y
\begin{bmatrix}
x\\
y
\end{bmatrix} =
\begin{bmatrix}
x\\
y+kx
\end{bmatrix},
$$

with matrix

$$
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 \(x\)-Shear

Consider

$$
H_x=
\begin{bmatrix}
1 & k\\
0 & 1
\end{bmatrix}.
$$

It sends

$$
\begin{bmatrix}
x\\
y
\end{bmatrix}
$$

to

$$
\begin{bmatrix}
x+ky\\
y
\end{bmatrix}.
$$

Points on the \(x\)-axis have \(y=0\), so

$$
H_x
\begin{bmatrix}
x\\
0
\end{bmatrix} =
\begin{bmatrix}
x\\
0
\end{bmatrix}.
$$

Thus the \(x\)-axis is fixed pointwise.

Horizontal lines are preserved as horizontal lines because \(y\) is unchanged. A point farther from the \(x\)-axis is shifted more in the \(x\)-direction.

The unit square with vertices

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

is sent to the parallelogram with vertices

$$
(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

$$
H_x=
\begin{bmatrix}
1 & k\\
0 & 1
\end{bmatrix}
$$

is

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

Similarly,

$$
\det
\begin{bmatrix}
1 & 0\\
k & 1
\end{bmatrix}
=1.
$$

Thus these shears preserve signed area.

In higher dimensions, elementary shear matrices have determinant \(1\). 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

$$
H_x=
\begin{bmatrix}
1 & k\\
0 & 1
\end{bmatrix},
$$

the inverse is

$$
H_x^{-1}=
\begin{bmatrix}
1 & -k\\
0 & 1
\end{bmatrix}.
$$

Indeed,

$$
\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,

$$
\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

$$
H_x=
\begin{bmatrix}
1 & k\\
0 & 1
\end{bmatrix}
$$

has characteristic polynomial

$$
\det(H_x-\lambda I) =
\det
\begin{bmatrix}
1-\lambda & k\\
0 & 1-\lambda
\end{bmatrix} =
(1-\lambda)^2.
$$

Thus the only eigenvalue is

$$
\lambda=1.
$$

If \(k\neq 0\), the eigenspace is found by solving

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

Now

$$
H_x-I=
\begin{bmatrix}
0 & k\\
0 & 0
\end{bmatrix}.
$$

So

$$
ky=0.
$$

Since \(k\neq 0\),

$$
y=0.
$$

Therefore the eigenspace is the \(x\)-axis:

$$
\operatorname{span}
\left\{
\begin{bmatrix}
1\\
0
\end{bmatrix}
\right\}.
$$

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

## 41.12 Shears and Diagonalization

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

For

$$
H_x=
\begin{bmatrix}
1 & k\\
0 & 1
\end{bmatrix},
\qquad k\neq 0,
$$

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

Thus \(H_x\) cannot be diagonalized.

It can be written as

$$
H_x=I+N,
$$

where

$$
N=
\begin{bmatrix}
0 & k\\
0 & 0
\end{bmatrix}.
$$

The matrix \(N\) is nilpotent because

$$
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,
$$

where

$$
N^2=0.
$$

Then

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

for every integer \(m\geq 0\).

For the shear

$$
H_x=
\begin{bmatrix}
1 & k\\
0 & 1
\end{bmatrix},
$$

this gives

$$
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 \(y\).

The inverse powers are

$$
H_x^{-m}=
\begin{bmatrix}
1 & -mk\\
0 & 1
\end{bmatrix}.
$$

## 41.14 Elementary Shears in Higher Dimensions

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

For example, in \(\mathbb{R}^3\),

$$
H
\begin{bmatrix}
x\\
y\\
z
\end{bmatrix} =
\begin{bmatrix}
x+ky\\
y\\
z
\end{bmatrix}
$$

has matrix

$$
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 \(k\). It has determinant \(1\) and is invertible. Its inverse is obtained by replacing \(k\) with \(-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=
\begin{bmatrix}
1 & 0 & 0\\
k & 1 & 0\\
0 & 0 & 1
\end{bmatrix}
$$

adds \(k\) times row \(1\) to row \(2\).

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

$$
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=
\begin{bmatrix}
1 & 0 & 0\\
0 & c & 0\\
0 & 0 & 1
\end{bmatrix}
$$

multiplies row \(2\) by \(c\).

It is invertible exactly when

$$
c\neq 0.
$$

Its inverse is

$$
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 \(\mathbb{R}^2\), an \(x\)-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 \(1\).

In \(\mathbb{R}^n\), an elementary shear has determinant \(1\), so it preserves signed \(n\)-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=\lambda I
$$

in \(\mathbb{R}^n\) has determinant

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

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

A nonuniform scaling

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

has determinant

$$
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=
\begin{bmatrix}
1 & k\\
0 & 1
\end{bmatrix},
\qquad
S=
\begin{bmatrix}
a & 0\\
0 & b
\end{bmatrix}.
$$

Then

$$
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=
\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,

$$
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

$$
x\mapsto x+b
$$

with \(b\neq 0\) is not linear because it sends

$$
0
$$

to

$$
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=\operatorname{diag}(s_1,\ldots,s_n).
$$

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

$$
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 \(\mathbb{R}^2\), standard shear matrices are

$$
\begin{bmatrix}
1 & k\\
0 & 1
\end{bmatrix}
$$

and

$$
\begin{bmatrix}
1 & 0\\
k & 1
\end{bmatrix}.
$$

A nontrivial shear is invertible, has determinant \(1\), 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.
