Affine map (source code)

= Affine map
{title2=$x\mapsto Ax+b$}

An <affine map> combines a <linear map> with a <translation>. After choosing coordinate origins, it has the form $T:\mathbb R^p\to\mathbb R^q$, $T(x)=Mx+b$, where the $q\times p$ <matrix> $M$ is its <linear part of an affine map> and $b$ is a fixed <vector>. Equivalently, it preserves every <affine combination>. <Curves and Surfaces in Geometric Modeling: Theory and Algorithms by Jean Gallier>[§2.7, Definition 2.7.1 and linear-map construction, pp. 37–38]{ref}

An original planar example is
$$
T(x,y)=(2x+y+1,y-2),\qquad M=\begin{pmatrix}2&1\\0&1\end{pmatrix},\qquad b=\begin{pmatrix}1\\-2\end{pmatrix}.
$$
It stretches horizontally, applies a <shear mapping>, and then translates. The vertices $A=(0,0)$, $B=(2,0)$ and $C=(0,2)$ become $A'=(1,-2)$, $B'=(5,-2)$ and $C'=(3,0)$. A <square grid> becomes a grid of <parallelograms>; straight edges and their weighted points still fit together.

\Image[/affine-map-triangle-and-grid.png]
{title=An affine map preserves straightness while changing lengths and angles}
{description=An original <triangle> and finite window of a <square grid>, followed by their images under $T(x,y)=(2x+y+1,y-2)$. The right-hand grid is the transformed left-hand grid. Equal axis scales make the altered <lengths> and <angles> visible.}

This map is not a <linear map> with respect to the displayed origins, because $T(0,0)=(1,-2)$ rather than zero. It also is not a <Euclidean similarity>: $AB$ has <length> $2$ and $A'B'$ has <length> $4$, while the right <angle> at $A$ becomes $45^\circ$. Its <determinant> is $2$, so it doubles planar <area>. These metric changes explain why <affine geometry> studies straightness, incidence and weighted points rather than treating every transformation as an <isometry>.

The linear part is an <invertible matrix>, giving the concise inverse \b[$T^{-1}(u,v)=((u-v-3)/2,v+2)$]. More generally an <affine map> is <bijective> exactly when its <linear part of an affine map> is <bijective>. Between equal finite-dimensional spaces, this means an <invertible matrix>; the <translation> cannot repair a loss of <rank of a linear map>.