As shown above, an affine map is the composition of two functions: a translation and a linear map. Ordinary vector algebra uses
matrix multiplication to represent linear maps, and
vector addition to represent translations. Formally, in the finite-dimensional case, if the linear map is represented as a multiplication by an invertible matrix A and the translation as the addition of a vector \mathbf{b}, an affine map f acting on a vector \mathbf{x} can be represented as \mathbf{y} = f(\mathbf{x}) = A \mathbf{x} + \mathbf{b}.
Augmented matrix Using an
augmented matrix and an augmented vector, it is possible to represent both the translation and the linear map using a single
matrix multiplication. The technique requires that all vectors be augmented with a "1" at the end, and all matrices be augmented with an extra row of zeros at the bottom, an extra column—the translation vector—to the right, and a "1" in the lower right corner. If A is a matrix, \begin{bmatrix} \mathbf{y} \\ 1 \end{bmatrix} = \left[ \begin{array}{ccc|c} & A & & \mathbf{b} \\ 0 & \cdots & 0 & 1 \end{array} \right] \begin{bmatrix} \mathbf{x} \\ 1 \end{bmatrix} is equivalent to the following \mathbf{y} = A \mathbf{x} + \mathbf{b}. The above-mentioned augmented matrix is called an
affine transformation matrix. In the general case, when the last row vector is not restricted to be \left[ \begin{array}{ccc|c} 0 & \cdots & 0 & 1 \end{array} \right], the matrix becomes a
projective transformation matrix (as it can also be used to perform
projective transformations). This representation exhibits the
set of all
invertible affine transformations as the
semidirect product of K^n and \operatorname{GL}(n, K). This is a
group under the operation of composition of functions, called the
affine group. Ordinary matrix-vector multiplication always maps the origin to the origin, and could therefore never represent a translation, in which the origin must necessarily be mapped to some other point. By appending the additional coordinate "1" to every vector, one essentially considers the space to be mapped as a subset of a space with an additional dimension. In that space, the original space occupies the subset in which the additional coordinate is 1. Thus the origin of the original space can be found at (0,0, \dotsc, 0, 1). A translation within the original space by means of a linear transformation of the higher-dimensional space is then possible (specifically, a shear transformation). The coordinates in the higher-dimensional space are an example of
homogeneous coordinates. If the original space is
Euclidean, the higher dimensional space is a
real projective space. The advantage of using homogeneous coordinates is that one can
combine any number of affine transformations into one by multiplying the respective matrices. This property is used extensively in
computer graphics,
computer vision and
robotics.
Example augmented matrix Suppose you have three points that define a non-degenerate triangle in a plane, or four points that define a non-degenerate tetrahedron in 3-dimensional space, or generally points , ..., that define a non-degenerate
simplex in -dimensional space. Suppose you have corresponding destination points , ..., , where these new points can lie in a space with any number of dimensions. (Furthermore, the new points need not form a non-degenerate simplex, nor even be distinct from each other.) The unique augmented matrix that achieves the affine transformation \begin{bmatrix}\mathbf{y}_i\\1\end{bmatrix} = M \begin{bmatrix}\mathbf{x}_i\\1\end{bmatrix} for every is M = \begin{bmatrix}\mathbf{y}_1&\cdots&\mathbf{y}_{n+1}\\1&\cdots&1\end{bmatrix} \begin{bmatrix}\mathbf{x}_1&\cdots&\mathbf{x}_{n+1}\\1&\cdots&1\end{bmatrix}^{-1}, using
matrix inversion. ==Properties==