The VikiD Truth

Knowledge base / Mathematics

An affine transformation is any transformation that preserves:

That’s the textbook line. Here’s the truth behind it: an affine transformation is a linear transformation that’s allowed to move the origin. Stretch, rotate, shear, flip, and then slide the whole picture somewhere else.

The core idea, in plain words

A linear map must send the origin to the origin. That’s too strict for everyday geometry: simply sliding a drawing two centimetres to the right isn’t linear, because the origin moves. So we allow one extra term:

T(x)=Ax+b, T(\mathbf{x}) = A\mathbf{x} + \mathbf{b},

where AA is a matrix (the linear part) and b\mathbf{b} is a fixed vector (the shift, or translation).

That’s it. And the two promises at the top of the page follow:

What is not promised: lengths and angles. A shear turns squares into slanted parallelograms. (When lengths are kept too, it’s called an isometry, the rigid motions, as on the Topology page.)

An everyday analogy: a projector on a wall

Put a slide in an old overhead projector. Adjust the zoom, rotate the slide, tilt the image sideways as a shear, and slide the whole thing across the wall. Straight lines on the slide stay straight on the wall, parallel lines stay parallel, and the middle of a line stays in the middle. That’s affine. What an affine map can’t do is the keystone effect you get when the projector points up at an angle, where parallel lines start to converge. That’s a projective map, one level further out.

A worked example: rotate about a point other than the origin

Rotate the plane 90° anticlockwise about the point c=(2,1)\mathbf{c} = (2, 1). The trick: slide c\mathbf{c} to the origin, rotate, slide back.

The rotation matrix is R=(0−110)R = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}. So

T(x)=R(x−c)+c=Rx+(c−Rc). T(\mathbf{x}) = R(\mathbf{x} - \mathbf{c}) + \mathbf{c} = R\mathbf{x} + (\mathbf{c} - R\mathbf{c}).

Rc=(−1,2)R\mathbf{c} = (-1, 2), so b=(2,1)−(−1,2)=(3,−1)\mathbf{b} = (2, 1) - (-1, 2) = (3, -1) and

T(x,y)=(−y+3, x−1). T(x, y) = (-y + 3,\ x - 1).

Check: T(2,1)=(2,1)T(2, 1) = (2, 1). The centre stays put. ✔ And T(3,1)=(2,2)T(3, 1) = (2, 2): the point one step to the right of the centre swings to one step above it. ✔

Here’s a beautiful trick computer graphics uses every frame. Write a point as (x,y,1)(x, y, 1), with an extra 1 on the end. Then the affine map becomes one 3×33 \times 3 matrix:

(0−1310−1001)(xy1)=(−y+3x−11). \begin{pmatrix} 0 & -1 & 3 \\ 1 & 0 & -1 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix} = \begin{pmatrix} -y + 3 \\ x - 1 \\ 1 \end{pmatrix}.

Translation, which wasn’t linear, has become linear one dimension up. Chaining moves is now just multiplying matrices.

A picture in words: graph paper on a sliding rubber sheet

Draw a square grid on a rubber sheet pinned to a table. A linear map stretches and turns the sheet with the pin held fixed. An affine map lets you also pull the pin out and slide the whole sheet. Either way the grid stays a grid of identical parallelograms, every square becomes the same slanted shape, and the area of every one is scaled by ∣det⁡A∣|\det A|.

graph LR
  I["Isometries: keep distances"] --> A["Affine: keep lines and ratios"]
  L["Linear: keep the origin too"] --> A
  A --> P["Projective: keep lines only"]
  P --> H["Homeomorphisms: keep only nearness"]

Common misconceptions

How it connects

The truth revealed: geometry without a fixed origin is still linear algebra. You just have to look one dimension higher.

Last edited · 1 revisions

Tags: #Math