An affine map is a function of the form
where:
is a matrix representing a linear transformation is a fixed vector representing a translation
So an affine map is basically:
a linear transformation followed by a shift
Main idea
A linear transformation must send the origin to the origin.
That is because if
But many useful geometric transformations do not keep the origin fixed.
For example,
just translates every point by the same amount. This is not linear, but it is affine.
So affine maps are the natural class of transformations that include:
- rotation
- scaling
- shear
- reflection
- translation
- any combination of these
General form
In
If
So every linear map is affine, but not every affine map is linear.
Example
Suppose
Then
This transformation:
- scales in the
-direction by 2 - scales in the
-direction by 3 - shifts everything right by 1
- shifts everything down by 4
Why affine maps matter
Affine maps describe the kinds of transformations we usually care about in geometry and graphics.
They preserve:
- straight lines
- parallelism
- ratios along the same line
But they do not necessarily preserve:
- lengths
- angles
So affine geometry is less rigid than Euclidean geometry, but still keeps a lot of the important structure.
Connection to Homogeneous Coordinates
Affine maps are not purely linear in ordinary coordinates because of the extra
But in Homogeneous Coordinates, an affine map becomes a single matrix multiplication.
For a 2D point, write
Then the affine map
can be written as
In 2D this looks like
This is why homogeneous coordinates are so useful: they let affine maps be handled with the same matrix machinery as linear maps.
Intuition
The cleanest way to think about an affine map is:
- first reshape space linearly
- then move the whole result
So if a linear map tells you how vectors change, an affine map tells you how points in space change.