2D Scaling

Scaling is the transformation that changes the size of an object in 2D space making it larger, smaller, or distorting it unevenly along the X and Y directions. 

Unlike translation and rotation, scaling is not a rigid-body transformation: it can alter both the size and, if applied unevenly, the shape of an object.

What is Scaling?

Scaling resizes an object along the X and Y directions by multiplying each coordinate of every point by a corresponding scale factor:

  • sx — scale factor along the X-axis
  • sy — scale factor along the Y-axis

If a scale factor is greater than 1, the object expands along that axis. If it lies between 0 and 1, the object shrinks along that axis. A scale factor of exactly 1 leaves that dimension unchanged.


Mathematical Definition

For a point P(x, y), after scaling by factors (sx, sy), the new point P'(x', y') is given by:

x' = x · sx
y' = y · sy

The Scaling Matrix

Using homogeneous coordinates, the 2D scaling matrix about the origin is a 3×3 matrix:

S(sx, sy) = | sx  0   0 |
            | 0   sy  0 |
            | 0   0   1 |

Applying this to a point P(x, y, 1):

| x' |   | sx  0   0 | | x |
| y' | = | 0   sy  0 | | y |
| 1  |   | 0   0   1 | | 1 |

Expanding confirms it reproduces the basic equations:

x' = sx·x + 0·y + 0·1 = sx·x
y' = 0·x + sy·y + 0·1 = sy·y

Types of Scaling

1. Uniform Scaling

When sx = sy, the object grows or shrinks proportionally in both directions. Its overall shape is preserved only its size changes. This is the most common form of scaling used in practice (e.g., zooming in/out on an image without distorting it).

2. Non-Uniform (Differential) Scaling

When sx ≠ sy, the object is distorted stretched more along one axis than the other. This changes the object's proportions, not just its overall size. For example, scaling a circle non-uniformly turns it into an ellipse.

3. Special Cases

  • sx = sy = 1: Identity transformation — no change.
  • A scale factor = 0: The object collapses completely along that axis, flattening it onto a line.
  • A scale factor is negative: The object is both scaled and reflected (mirrored) along that axis. For example, sx = -1 reflects the object across the Y-axis while keeping its size the same. This shows that reflection is a special case of scaling with a negative scale factor.

Geometric Interpretation

Scaling about the origin treats the origin as a fixed anchor point points closer to the origin move less, and points farther away move more, all in proportion to the scale factor. 

This means scaling about the origin can unintentionally shift an object's apparent position if the object isn't centered at the origin to begin with.


Scaling about an Arbitrary Fixed Point

In most practical cases, you want to scale an object relative to its own center (or another chosen pivot point), not the world origin, so it grows or shrinks "in place."

Procedure

To scale an object by (sx, sy) about a fixed point F(px, py):

  1. Translate the fixed point to the origin: T(-px, -py)
  2. Scale about the origin: S(sx, sy)
  3. Translate back to the original location: T(px, py)

Combined Matrix

S' = T(px, py) · S(sx, sy) · T(-px, -py)

Multiplying these out gives the combined matrix directly:

S' = | sx   0    px(1 - sx) |
     | 0    sy   py(1 - sy) |
     | 0    0        1      |

Expanded Formulas

x' = sx(x - px) + px
y' = sy(y - py) + py

This confirms that each coordinate is scaled relative to its distance from the fixed point, and the fixed point itself remains unmoved (substituting x = px, y = py gives x' = px, y' = py).


Properties of 2D Scaling

  1. Not a rigid-body transformation: Scaling changes the size of an object (and shape, if non-uniform).
  2. Inverse of scaling: The inverse of S(sx, sy) is:

    S^-1(sx, sy) = S(1/sx, 1/sy)

    This is only valid when neither scale factor is zero.

  3. Composition of successive scalings: Applying two scalings in sequence multiplies the corresponding scale factors:

    S(sx1, sy1) · S(sx2, sy2) = S(sx1·sx2, sy1·sy2)
  4. Commutativity: Scaling matrices about the same fixed point commute with each other:

    S(a) · S(b) = S(b) · S(a)
  5. Does not commute with translation or rotation in general: Scaling about the origin and then translating gives a different result than translating first and then scaling.
  6. Determinant: The determinant of S(sx, sy) is sx·sy, representing the area scale factor how much the object's area is multiplied by after scaling.

Solved Numerical Problems

Problem 1

A point P(3, 4) is scaled using scale factors (2, 3). Find the new coordinates.

Solution:

x' = x · sx = 3 × 2 = 6
y' = y · sy = 4 × 3 = 12

New point P' = (6, 12)

Problem 2

Find the scaling matrix for uniform scaling with factor 1.5, and use it to scale the point (4, -6).

Solution:

Scaling matrix:

S(1.5, 1.5) = | 1.5  0    0 |
              | 0    1.5  0 |
              | 0    0    1 |

Applying to point (4, -6, 1):

x' = 1.5 × 4 = 6
y' = 1.5 × (-6) = -9

New point P' = (6, -9)

Problem 3

A rectangle has corners at A(1, 1) and the diagonally opposite corner B(5, 3). Scale it by factors (2, 2) about the origin. Find the new positions of A and B, and verify the area scale factor matches sx·sy.

Solution:

Scaled points:

A' = (1×2, 1×2) = (2, 2)
B' = (5×2, 3×2) = (10, 6)

Original rectangle dimensions: width = 5-1 = 4, height = 3-1 = 2, so original area = 4 × 2 = 8.

New dimensions: width = 10-2 = 8, height = 6-2 = 4, so new area = 8 × 4 = 32.

Area ratio = 32 / 8 = 4

Expected area scale factor = sx · sy = 2 × 2 = 4 Matches.

Problem 4

A point P(6, 8) is scaled by factors (0.5, 0.5) about a fixed point F(2, 2) instead of the origin.

Solution:

Step 1: Translate F to origin:

P1 = (6-2, 8-2) = (4, 6)

Step 2: Scale by (0.5, 0.5):

P2 = (4×0.5, 6×0.5) = (2, 3)

Step 3: Translate back by adding (2, 2):

P3 = (2+2, 3+2) = (4, 5)

Final point P' = (4, 5)

Verification using the direct formula:

x' = sx(x - px) + px = 0.5(6-2) + 2 = 2 + 2 = 4
y' = sy(y - py) + py = 0.5(8-2) + 2 = 3 + 2 = 5

Matches: P' = (4, 5) 

Problem 5

A point P(2, 3) is scaled by factors (-1, 1). Describe what happens geometrically, and find its new coordinates.

Solution:

x' = 2 × (-1) = -2
y' = 3 × 1 = 3

New point P' = (-2, 3)

Geometric interpretation: Since sx is negative and sy is +1, the point is reflected across the Y-axis (its X-coordinate flips sign), with no change in size since |sx| = |sy| = 1. This demonstrates that reflection across the Y-axis is equivalent to scaling with sx = -1.

Problem 6 (Practice try it yourself)

A triangle has vertices A(0, 0), B(4, 0), and C(0, 2). Scale the triangle by factors (3, 1.5) about the origin. Find the new coordinates of all three vertices, compute the new area, and verify it matches the expected area scale factor (sx × sy) applied to the original area.

(Hint: original area = ½ × base × height = ½ × 4 × 2 = 4.)


Conclusion

2D scaling completes the trio of fundamental 2D transformations alongside translation and rotation. While conceptually simple multiply each coordinate by a scale factor care must be taken with the reference point: scaling about the wrong pivot can shift an object's position unintentionally. 

The "translate–scale–translate back" technique for scaling about an arbitrary fixed point is a pattern that reappears throughout transformation theory, including in rotation about an arbitrary pivot.

Previous Post
2D Rotation
Next Post
2D Composite Transformations
0 people found this article helpful

Was this article helpful?