Affine Transformations: Linear Maps Plus a Shift

A linear transformation must send the zero vector to the zero vector. An affine transformation relaxes this by allowing an extra fixed shift, or translation, added after the linear part. Formally,


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


where AA is an m×nm\times n matrix and b\mathbf{b} is a fixed vector in Rm\mathbb{R}^m. If b=0\mathbf{b}=\mathbf{0}, TT is linear; otherwise T(0)=b≠0T(\mathbf{0})=\mathbf{b}\neq\mathbf{0}, so an affine map is not a linear transformation whenever the translation is nonzero.

Key idea

Every affine map is exactly “apply a linear transformation, then slide the whole picture.” Sliding a picture cannot bend a straight line or change where a point sits along it, so affine maps preserve collinearity and affine combinations: if p=(1−t)p0+tp1\mathbf{p}=(1-t)\mathbf{p}_0+t\mathbf{p}_1, then T(p)=(1−t)T(p0)+tT(p1)T(\mathbf{p})=(1-t)T(\mathbf{p}_0)+tT(\mathbf{p}_1) with the same parameter tt, for every AA and b\mathbf{b}.


That parameter is a genuine ratio of lengths along the image line only when the image segment does not collapse to a single point, which is guaranteed when AA is invertible.


A singular AA can crush a whole segment to one point (for A=0A=0 every point goes to b\mathbf{b}), and the length ratio there is 0/00/0, undefined.


Affine maps generally do not preserve distances or angles: those depend only on the linear part, and hold when AA is an isometry (ATA=IA^TA=I).


The translation b\mathbf{b} can be any fixed vector without affecting them, since sliding a picture changes neither lengths nor angles. What b\mathbf{b} does control is the origin, which stays fixed only when b=0\mathbf{b}=\mathbf{0}.

The unit square (blue) is first carried to a parallelogram by the linear part Ax (grey, dashed), then slid by the translation vector b (orange arrow) to the final affine image Ax + b (red). The linear step changes side lengths and angles; the translation step changes only position.

The unit square (blue) is first carried to a parallelogram by the linear part Ax (grey, dashed), then slid by the translation vector b (orange arrow) to the final affine image Ax + b (red). The linear step changes side lengths and angles; the translation step changes only position.

Scaling test for the lesson's map T(x,y) = (x + 3y − 2, 2x − y + 4) along the direction u = (1, 1)

Scaling test for the lesson's map T(x,y) = (x + 3y − 2, 2x − y + 4) along the direction u = (1, 1)

Reading AA and b\mathbf{b} off sample images

Two facts recover the map from data. First, T(0)=A0+b=bT(\mathbf{0})=A\mathbf{0}+\mathbf{b}=\mathbf{b}, so the image of the origin is the translation. Second, once b\mathbf{b} is known, T(ej)−b=AejT(\mathbf{e}_j)-\mathbf{b}=A\mathbf{e}_j is the jj-th column of AA. The subtraction is essential: the raw images T(ej)T(\mathbf{e}_j) are not the columns of AA unless b=0\mathbf{b}=\mathbf{0}.

Homogeneous coordinates

Affine maps can be written as a single matrix acting on an augmented vector:


(T(x)1)=(Ab0T1)(x1)\begin{pmatrix} T(\mathbf{x}) \\ 1 \end{pmatrix} = \begin{pmatrix} A & \mathbf{b} \\ \mathbf{0}^T & 1 \end{pmatrix}\begin{pmatrix} \mathbf{x} \\ 1 \end{pmatrix}


This is why graphics pipelines carry an extra coordinate: it turns "linear map, then translate" into one matrix product that composes cleanly.

Worked example

Let T(x,y)=(x+3y−2,  2x−y+4)T(x,y) = (x+3y-2,\; 2x-y+4), so A=(132−1)A=\begin{pmatrix}1&3\\2&-1\end{pmatrix} and b=(−2,4)\mathbf{b}=(-2,4). Then T(1,2)=(1+6−2,  2−2+4)=(5,4)T(1,2) = (1+6-2,\; 2-2+4) = (5,4), and T(0,0)=(−2,4)=bT(0,0)=(-2,4)=\mathbf{b}, which is the origin check in action.

Inverting an affine map

When AA is invertible, the unique preimage is x=A−1(y−b)\mathbf{x}=A^{-1}(\mathbf{y}-\mathbf{b}). If AA is singular, A−1A^{-1} does not exist: a vector y−b\mathbf{y}-\mathbf{b} outside the image of AA has no preimage, while any one solution can be shifted by a nonzero vector in ker⁡A\ker A to give another.


For example, if A=0A=0 and y=b\mathbf{y}=\mathbf{b}, every input is a preimage. When AA is invertible, subtract the translation before applying A−1A^{-1}, reversing the order of the map. Applying A−1A^{-1} directly to y\mathbf{y} gives a value that differs from the preimage by A−1bA^{-1}\mathbf{b}.



Which statement correctly defines an affine transformation T:Rn→RmT:\mathbb{R}^n\to\mathbb{R}^m?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Let T(x,y)=(3x−y+2,  x+2y−5)T(x,y) = (3x-y+2,\; x+2y-5) be an affine transformation on R2\mathbb{R}^2. Compute the first coordinate of T(2,−1)T(2,-1).

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

An affine transformation T:R2→R2T:\mathbb{R}^2\to\mathbb{R}^2 has the form T(x)=Ax+bT(\mathbf{x}) = A\mathbf{x}+\mathbf{b}. Three of its input–output pairs are recorded below.

  • (0,0)↦(1,−1)(0,0)\mapsto(1,-1)
  • (1,0)↦(2,−2)(1,0)\mapsto(2,-2)
  • (0,1)↦(3,0)(0,1)\mapsto(3,0)

Determine AA and b\mathbf{b}.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors