01 / 20

Scaling & Stretching
Along Axes

Learn how scaling matrices stretch, compress, and reflect vectors along coordinate axes: the building blocks of every linear transformation.

Linear Algebra

What Is Scaling?

Scaling is a linear transformation that multiplies each coordinate of a vector by a constant factor. When we scale a point \((x, y)\), we produce a new point \((a \cdot x,\; b \cdot y)\) where \(a\) and \(b\) are the scale factors along the \(x\)-axis and \(y\)-axis respectively.

The Scaling Matrix

In 2D, scaling is represented by a diagonal matrix. When we multiply a vector \(\mathbf{v} = \begin{pmatrix} x \\ y \end{pmatrix}\) by the scaling matrix, we get:

The factor \(a\) controls horizontal stretching, and \(b\) controls vertical stretching. The zeros off the diagonal mean the axes act independently.

Visualizing Scaling on a Unit Square

1 2 3 4 1 2 3 0 Original Scaled (3, 2) a = 3 b = 2

What Scale Factors Mean

\(k > 1\)
Stretches the axis: points move away from the origin.
\(0 < k < 1\)
Compresses the axis: points move toward the origin.
\(k < 0\)
Reflects and scales: the axis flips through the origin.

Core Rule: Diagonal Matrices

A scaling transformation in \(\mathbb{R}^n\) is always represented by a diagonal matrix whose diagonal entries are the scale factors:

The determinant of this matrix is \(\det(S) = s_1 \cdot s_2 \cdots s_n\), which measures how the transformation scales area (2D) or volume (3D).

Eigenvectors of Scaling

x y e₁ 2e₁ e₂ 3e₂ v Sv O

Uniform vs Non-Uniform Scaling

Uniform Scaling
\(a = b\): same factor on every axis. Shapes preserve proportions. The matrix is \(k \cdot I\).
Non-Uniform Scaling
\(a \neq b\): different factors per axis. Circles become ellipses, squares become rectangles.
Uniform (2, 2) Non-Uniform (3, 1.5)

Scaling with Reflection

When a scale factor is negative, the transformation includes a reflection across the perpendicular axis. For example, \(a = -1\) reflects all points across the \(y\)-axis.

x y Original Reflected y-axis (mirror)

How to Apply Scaling

1
Identify the scale factors. Determine \(a\) (horizontal) and \(b\) (vertical) from the problem context.
2
Build the diagonal matrix. Write \(S = \begin{pmatrix} a & 0 \\ 0 & b \end{pmatrix}\).
3
Multiply each point. Compute \(S\mathbf{v}\) for every vector \(\mathbf{v}\) in your shape or dataset.
4
Interpret the result. Check the determinant \(a \cdot b\): it tells you the area scale factor (and sign tells orientation).

Example 1: Simple Stretch

Scale the point \(\mathbf{v} = \begin{pmatrix} 3 \\ 2 \end{pmatrix}\) by \(a = 2\) horizontally and \(b = 4\) vertically.

The \(x\)-component doubled from 3 to 6, and the \(y\)-component quadrupled from 2 to 8. The area scale factor is \(\det(S) = 2 \times 4 = 8\).

Example 2: Compression

A rectangle has corners at \((0,0)\), \((4,0)\), \((4,6)\), and \((0,6)\). Apply \(S = \begin{pmatrix} \frac{1}{2} & 0 \\ 0 & \frac{1}{3} \end{pmatrix}\).

0 1 2 3 4 1 2 3 4 5 6 Original (4 x 6) Scaled (2 x 2)

Example 3: 3D Scaling

Scale the vector \(\mathbf{v} = \begin{pmatrix} 1 \\ -2 \\ 5 \end{pmatrix}\) with factors \(s_1 = 3\), \(s_2 = 1\), \(s_3 = -2\).

The \(x\)-component tripled, the \(y\)-component stayed the same (\(s_2 = 1\)), and the \(z\)-component was reflected and doubled (\(s_3 = -2\)). The volume scale factor: \(\det(S) = 3 \times 1 \times (-2) = -6\) (orientation reversed).

Key Properties

1
Commutative. Scaling matrices commute: \(S_1 S_2 = S_2 S_1\). The order doesn't matter.
2
Easy inverse. If all \(s_i \neq 0\), then \(S^{-1} = \text{diag}(1/s_1, \ldots, 1/s_n)\).
3
Eigenvalues are explicit. The diagonal entries are the eigenvalues; the standard basis vectors are the eigenvectors.
4
Determinant = product. \(\det(S) = \prod s_i\) gives the signed volume/area scale factor.

Common Mistakes

✕ Confusing Scale with Translate
Scaling moves points multiplicatively. Adding a constant to coordinates is translation, which is not a linear transformation (it doesn't preserve the origin).
✕ Forgetting the Origin
Scaling always fixes the origin. If you want to scale about a different center, you must translate, scale, translate back.
✕ Area vs. Length Factor
If lengths scale by \(k\), area scales by \(k^2\) (uniform) or by \(\det(S)\) (non-uniform). Don't use the length factor for area.

Comparison Summary

Uniform Scaling Non-Uniform Scaling Reflection
Matrix \(kI\) \(\text{diag}(a, b)\), \(a \neq b\) \(\text{diag}(1, -1)\) (example)
Shape preserved? Yes No Yes
Orientation Same Same (if both > 0) Reversed
Determinant \(k^n\) \(a \cdot b\) \(-1\)
Example Zoom in/out Stretch photo Mirror image

Question 1 of 5

What is the result of applying \(S = \begin{pmatrix} 3 & 0 \\ 0 & 2 \end{pmatrix}\) to the vector \(\begin{pmatrix} 4 \\ 5 \end{pmatrix}\)?

Question 2 of 5

A square with area \(9\) is scaled by \(S = \begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix}\). What is the area of the resulting rectangle?

Question 3 of 5

Which matrix represents a reflection across the \(x\)-axis?

Question 4 of 5

If \(S = \begin{pmatrix} 5 & 0 \\ 0 & 5 \end{pmatrix}\), which statement is true?

Question 5 of 5

What is the inverse of the scaling matrix \(S = \begin{pmatrix} 4 & 0 \\ 0 & \frac{1}{2} \end{pmatrix}\)?