Affine Transformations
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,
where A is an m×n matrix and b is a fixed vector in Rm. If b=0, T is linear; otherwise T(0)=b=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, then T(p)=(1−t)T(p0)+tT(p1) with the same parameter t, for every A and 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 A is invertible.
A singular A can crush a whole segment to one point (for A=0 every point goes to b), and the length ratio there is 0/0, undefined.
Affine maps generally do not preserve distances or angles: those depend only on the linear part, and hold when A is an isometry (ATA=I).
The translation b can be any fixed vector without affecting them, since sliding a picture changes neither lengths nor angles. What b does control is the origin, which stays fixed only when b=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.
Scaling test for the lesson's map T(x,y) = (x + 3y − 2, 2x − y + 4) along the direction u = (1, 1)
Reading A and b off sample images
Two facts recover the map from data. First, T(0)=A0+b=b, so the image of the origin is the translation. Second, once b is known, T(ej)−b=Aej is the j-th column of A. The subtraction is essential: the raw images T(ej) are not the columns of A unless b=0.
Homogeneous coordinates
Affine maps can be written as a single matrix acting on an augmented vector:
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), so A=(123−1) and b=(−2,4). Then T(1,2)=(1+6−2,2−2+4)=(5,4), and T(0,0)=(−2,4)=b, which is the origin check in action.
Inverting an affine map
When A is invertible, the unique preimage is x=A−1(y−b). If A is singular, A−1 does not exist: a vector y−b outside the image of A has no preimage, while any one solution can be shifted by a nonzero vector in kerA to give another.
For example, if A=0 and y=b, every input is a preimage. When A is invertible, subtract the translation before applying A−1, reversing the order of the map. Applying A−1 directly to y gives a value that differs from the preimage by A−1b.
Let T(x,y)=(3x−y+2,x+2y−5) be an affine transformation on R2. Compute the first coordinate of T(2,−1).
An affine transformation T:R2→R2 has the form T(x)=Ax+b. Three of its input–output pairs are recorded below.
- (0,0)↦(1,−1)
- (1,0)↦(2,−2)
- (0,1)↦(3,0)
Determine A and b.