An affine transformation is a mapping of the form x↦Ax+b, combining a linear transformation with a translation. If you are asking “what is an affine transformation?”, it is the broad geometry behind moving, rotating, scaling, reflecting and shearing objects while preserving straight lines and parallel structure.
A complete explanation of affine transformations must distinguish them from linear, rigid and projective transformations. The translation vector moves the origin. The matrix controls direction mixing, scale and shear. General affine maps preserve collinearity, parallelism and ratios along a line, but they do not necessarily preserve lengths, angles or circles.
This guide explains affine transformations from first principles: Ax+b, homogeneous coordinates, composition, inversion, determinant, barycentric coordinates, graphics, image registration, robotics, CAD, GIS, statistics, machine learning, optimisation, finite elements, mechanics, uncertainty and common errors. The goal is a durable operating model: separate the linear part from the translation and check which properties the application actually needs preserved.
What Is an Affine Transformation? A Short Definition
An affine transformation is a mapping of the form x↦Ax+b, combining a linear transformation A with a translation b. It preserves straight lines, parallelism and ratios along a line, but not necessarily lengths or angles. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Why Affine Transformations Matter
Affine transformations unify translation, rotation, reflection, scaling and shear in one framework. They appear in geometry, graphics, robotics, image registration, CAD, statistics, optimisation and coordinate conversion. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Affine Versus Linear Transformation
A linear transformation has form x↦Ax and must send zero to zero. An affine transformation adds b, so it can move the origin while retaining linear structure in differences. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Affine Versus Euclidean Transformation
A Euclidean rigid motion preserves distances and angles. An affine transformation may include unequal scaling and shear, so it preserves parallel lines but can change lengths and angles. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Affine Versus Similarity Transformation
A similarity transformation preserves angles and shape up to one uniform scale. A general affine transformation allows different scaling in different directions and shear. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Affine Versus Projective Transformation
Projective transformations preserve straight lines but not parallelism. Affine transformations form the special projective subclass in which parallel lines remain parallel. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
The Formula Ax+b
The matrix A controls direction mixing, scale, rotation, reflection and shear. The vector b controls translation. Separating these roles makes composition and inversion easier to understand. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
The Translation Part
The vector b is the image of the origin because T(0)=b. It therefore identifies where the source origin lands in the destination coordinates. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
The Linear Part
The matrix A acts on displacement vectors. Differences between transformed points satisfy T(q)-T(p)=A(q-p), so translation cancels from relative geometry. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Why Parallel Lines Stay Parallel
If two lines share direction d, their transformed directions are both Ad. Provided the transformation does not collapse that direction, the output lines remain parallel. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Why Collinearity Is Preserved
Points p,q,r lying on one line satisfy r=(1-t)p+tq for some scalar t. Affine maps preserve this combination, so their images remain collinear. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Affine Combinations
Coefficients that sum to one define affine combinations. An affine transformation commutes with these combinations, which explains preservation of barycentric relationships. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Midpoints
A midpoint is an affine combination with equal weights one half and one half. Therefore affine transformations send midpoints to midpoints. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Centroids
The centroid of finitely many points with equal weights summing to one transforms to the centroid of the transformed points. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Ratios Along a Line
If a point divides a segment in a fixed ratio, an invertible affine transformation preserves that ratio because both numerator and denominator scale by the same factor along that line. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Triangles
An affine transformation sends a nondegenerate triangle to another triangle when A is invertible. Edge lengths and angles can change, but collinearity and interior barycentric coordinates are preserved. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Parallelograms
A parallelogram remains a parallelogram because opposite edges are equal displacement vectors and parallelism is preserved. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Rectangles
A rectangle can become a general parallelogram under affine shear or unequal scaling because right angles need not be preserved. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Squares
A square can become a rectangle, rhombus or general parallelogram under different affine maps. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Circles
A circle generally becomes an ellipse under an invertible affine transformation. A rigid or similarity transformation is needed to preserve circular shape up to scale. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Ellipses
An ellipse remains an ellipse under an invertible affine transformation, though its centre, orientation and axis lengths can change. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Parabolas
A nondegenerate parabola remains a parabola under an invertible affine transformation because affine structure preserves the conic’s type relative to the line at infinity. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Hyperbolas
A nondegenerate hyperbola remains hyperbolic under invertible affine maps, although asymptote directions and metric parameters can change. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Conic Sections
Invertible affine transformations map nondegenerate conics to nondegenerate conics while preserving the affine distinctions among ellipse, parabola and hyperbola. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Affine Coordinates
An affine coordinate system uses an origin and a basis. Changing either through an invertible affine map changes coordinates without changing the underlying affine relationships. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Homogeneous Coordinates
Affine transformations can be represented by one larger matrix in homogeneous coordinates, placing A in the upper-left block and b in the final column. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Planar Homogeneous Matrix
A two-dimensional affine map can be stored in a 3×3 homogeneous matrix with bottom row [0,0,1] under the standard column-vector convention. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
3D Homogeneous Matrix
A three-dimensional affine map can be stored in a 4×4 matrix with bottom row [0,0,0,1]. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Why Homogeneous Form Helps
Homogeneous matrices let translation compose with rotation, scale and shear through ordinary matrix multiplication. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Affine Composition
Composing T1(x)=A1x+b1 and T2(x)=A2x+b2 gives T2(T1(x))=A2A1x+(A2b1+b2). Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Order of Composition
Affine transformations generally do not commute. Applying rotation then translation differs from translation then rotation. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Identity Affine Transformation
The identity uses A=I and b=0, leaving every point unchanged. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Inverse Affine Transformation
If A is invertible, T^{-1}(y)=A^{-1}(y-b). The inverse linear part is A^{-1} and the inverse translation is -A^{-1}b. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
When an Affine Map Is Not Invertible
If A is singular, the map collapses at least one direction and no unique inverse exists. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Rank Loss
A singular affine map can flatten a 3D object into a plane, collapse a plane into a line or collapse all points to one point depending on rank. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Determinant
For square A, det A gives signed area or volume scaling of the affine map. The translation b does not affect that scale factor. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Area Scaling
In 2D, absolute determinant |det A| multiplies every area under the affine map. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Volume Scaling
In 3D, |det A| multiplies every volume. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Orientation
A positive determinant preserves orientation, while a negative determinant reverses orientation. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Translation as an Affine Map
Pure translation uses A=I. It preserves every Euclidean distance and angle while moving the origin. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Rotation as an Affine Map
Rotation about the origin uses b=0 and orthogonal A. Rotation around another point is affine because translation to and from the pivot is required. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Reflection as an Affine Map
Reflection across a line or plane through the origin is linear; reflection across an offset line or plane is affine. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Scaling as an Affine Map
Scaling about the origin is linear. Scaling about another centre becomes affine. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Shear as an Affine Map
Shear through the origin is linear. A shear referenced to an offset line can be represented affinely. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Rigid Motion
Orientation-preserving rigid motions form a subset of affine transformations with orthogonal A and determinant +1. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Similarity Motion
Uniform scale combined with rigid motion is affine with A equal to a scalar times an orthogonal matrix. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Worked Example: Translation
For T(x,y)=(x+4,y-2), A=I and b=(4,-2). Every point moves by the same displacement. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Worked Example: Scale and Translate
For T(x,y)=(2x+3,0.5y-1), A=diag(2,0.5) and b=(3,-1). The map doubles horizontal scale, halves vertical scale and then translates. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Worked Example: Shear and Translate
T(x,y)=(x+2y+1,y-3) has linear part [[1,2],[0,1]] and translation (1,-3). Area scale is one because det A=1. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Worked Example: Inverse
For T(x)=2x+6 on the line, the inverse is x=(y-6)/2. Subtract translation first, then undo scaling. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Worked Example: Triangle
A triangle with vertices (0,0),(1,0),(0,1) transformed by A=[[2,1],[0,3]] and b=(4,-1) remains a triangle. Its area scales by |det A|=6. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Worked Example: Circle to Ellipse
Applying A=diag(3,1) to the unit circle produces x²/9+y²=1 in destination coordinates, an ellipse. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Worked Example: Midpoint
If p and q transform to p’ and q’, then midpoint m=(p+q)/2 transforms to (p’+q’)/2. Translation and linear terms distribute through the average. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Worked Example: Parallelogram
Four points p,p+u,p+v,p+u+v remain a parallelogram because their images have edges Au and Av. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Affine Basis
An affine basis consists of an origin point plus enough independent direction vectors to span the space. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Barycentric Coordinates
Barycentric coordinates express a point as an affine combination of triangle or simplex vertices whose coefficients sum to one. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Barycentric Invariance
Affine transformations preserve barycentric coordinates within corresponding simplices, making them useful for interpolation and finite elements. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Simplex
A simplex is the affine analogue of a minimal full-dimensional polytope: a segment in 1D, triangle in 2D and tetrahedron in 3D. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Affine Independence
Points are affinely independent when their displacement vectors from one chosen point are linearly independent. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Affine Hull
The affine hull of points is the smallest affine subspace containing them. It allows coefficients summing to one without nonnegativity restrictions. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Convex Hull
The convex hull further requires nonnegative affine coefficients. Affine maps send convex hulls to convex hulls of transformed points. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Affine Subspace
An affine subspace is a translated linear subspace. Lines and planes not passing through the origin are standard examples. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Plane Equation Under Affine Map
Plane normals transform with inverse transpose of A, while plane offsets also change because of b. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Normal Transformation
Under nonsingular affine linear part A, a surface normal transforms by A^{-T} before normalisation, not generally by A. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Why Normal Translation Vanishes
Translation changes a plane’s position but not its direction, so pure translation leaves its normal vector unchanged. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Affine Geometry
Affine geometry studies properties preserved by invertible affine transformations, such as parallelism, collinearity and ratios on one line. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
What Affine Geometry Ignores
Lengths, angles and circles are not fundamental affine invariants because general affine maps can change them. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Affine Frame
An affine frame combines an origin with an ordered basis. Coordinates of points are defined relative to that frame. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Change of Affine Frame
Changing affine frame generally requires both a basis change and an origin shift. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Computer Graphics
Graphics pipelines use affine transformations to position, rotate, scale and shear models before perspective projection. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Model Matrix
A model matrix commonly stores an object’s local-to-world affine transform. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
World Matrix
World transformation places local object coordinates into a shared scene frame. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
View Transform
A view transform is usually the inverse of the camera’s rigid affine pose, re-expressing world points in camera coordinates. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
2D Graphics
Vector drawing programs use affine transforms for moving, rotating, resizing and skewing shapes while retaining editable geometry. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Raster Images
Applying an affine map to a raster image requires resampling because transformed pixel centres rarely land exactly on the destination grid. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Image Warping
Affine image warping handles translation, rotation, scale and shear but cannot reproduce general perspective effects. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Image Registration
Affine registration aligns images under a six-parameter planar model when relative geometry includes translation, rotation, scale and shear. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Six Parameters in 2D
A general 2D affine map has four linear coefficients and two translation coefficients, giving six parameters. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Calibration Points
Three noncollinear point correspondences can determine a 2D affine transformation exactly in noise-free ideal conditions. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Why Collinearity Fails Calibration
If calibration points are collinear, they do not constrain full planar affine behaviour because directions away from the line remain ambiguous. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Least-Squares Affine Fit
With more noisy correspondences, affine parameters can be estimated by least squares and residuals used to judge model adequacy. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Residual Pattern
Systematic curved or perspective residuals suggest that a pure affine model is insufficient. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Computer Vision
Affine approximations are useful for small fields of view, nearly planar scenes or local image patches where full perspective can be approximated linearly. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Weak Perspective
Weak-perspective camera models can produce scaled orthographic, hence affine-like, image relationships under restricted depth variation. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Robotics
Rigid robot poses are affine transformations with orthogonal rotation blocks, while calibration can sometimes include scale or shear errors outside the ideal rigid model. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Pose Composition
Robot frame transforms compose using the affine rule for rotations and translations. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
CAD
CAD uses affine transformations to place components, assemblies and repeated geometry. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Manufacturing
Machine coordinate compensation can include affine-like scale, squareness and offset corrections in calibration models. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
GIS
Local map adjustments may be modelled by affine transformations when planar coordinates differ by shift, rotation, scale and shear. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Georeferencing
Raster georeferencing often uses affine transforms to map pixel row and column coordinates into projected map coordinates. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Six-Coefficient Geotransform
A planar raster geotransform can include origin, pixel size, rotation and shear terms, forming an affine map from pixel to map coordinates. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Maps and Perspective
An affine map cannot generally convert one arbitrary map projection into another because projection distortion is nonlinear over large regions. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Statistics
An affine transformation of a random vector changes its mean by Aμ+b and covariance by AΣA^T. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Gaussian Distribution
A nonsingular affine transformation of a multivariate Gaussian remains Gaussian with transformed mean and covariance. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Whitening
Whitening is affine when mean subtraction is included and linear after centring. It rotates and rescales covariance toward identity. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Standardisation
Z-score standardisation is affine coordinate-wise because it subtracts means and divides by standard deviations. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
PCA
PCA typically centres data and then applies an orthogonal linear map. The full centring-plus-rotation pipeline is affine. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Machine Learning
Dense neural layers compute Wx+b and are affine before nonlinear activation. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Why Neural Networks Need Nonlinearity
Composing affine layers without nonlinear activations collapses to one affine transformation, limiting representational power. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Affine Classifier
A binary linear classifier usually uses an affine score w·x+b, whose zero set is a hyperplane. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Hyperplane Decision Boundary
The equation w·x+b=0 defines an affine hyperplane. Translation term b determines its offset from the origin. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Support Vector Machine
A linear SVM uses an affine decision boundary even though the common name says linear classifier. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Optimisation
Affine constraints have form Ax=b or Ax≤b. They define hyperplanes and half-spaces. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Affine Constraint
An affine equality defines a translated subspace, while an affine inequality defines a half-space under nonzero normal. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Convexity Preservation
Affine maps preserve convexity, making them central in convex optimisation transformations. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Change of Variables
Affine substitutions simplify integrals, optimisation and differential equations when geometry is translated, rotated or scaled. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Jacobian of an Affine Map
The Jacobian of x↦Ax+b is constant and equal to A everywhere. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Area and Volume Change
The absolute determinant of A is the constant Jacobian factor for area or volume under invertible affine change of variables. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Finite Elements
Finite-element reference elements are often mapped to physical elements by affine transformations when elements have straight sides and compatible shapes. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Triangle Finite Element
Any nondegenerate triangle can be mapped affinely from a reference triangle, preserving barycentric coordinates. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Tetrahedral Finite Element
Any nondegenerate tetrahedron can be mapped affinely from a reference tetrahedron. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Mechanics
Homogeneous deformation of a small body region is modelled locally by an affine map consisting of a deformation gradient plus translation. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Deformation Gradient
The linear part describes local stretch, shear and rotation, while translation of the whole body does not affect strain. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Strain
Strain measures changes in relative geometry and is insensitive to pure rigid translation. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Crystal Lattices
Affine maps can deform lattice bases, turning square cells into parallelograms while preserving lattice connectivity under compatible transformations. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Affine Symmetry
A shape may have affine symmetries broader than Euclidean symmetries because length and angle need not be preserved. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Signals
Time scaling and shifting together form an affine transformation of the independent variable, such as t↦at+b. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Time Affine Change
Replacing time coordinate t with at+b can reverse, scale and shift a signal depending on sign and magnitude of a. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Units
Affine transformation coefficients can carry units. Adding b requires output units compatible with Ax. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Dimension Check
Matrix dimensions must match source and destination coordinate dimensions. Translation vector b must live in the destination space. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Conditioning
An invertible affine map can be numerically ill-conditioned when A strongly compresses one direction. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Affine Invariants
Parallelism, collinearity, ratios on a line and barycentric coordinates are affine invariants under invertible maps. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Non-Invariants
Distance, angle, circle radius, perpendicularity and ordinary dot products are not preserved by general affine transformations. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Worked Example: Affine Invariant Ratio
Points at x=0,2,6 on one line have segment ratio 2:4. Under x’=3x+5 they become 5,11,23, preserving ratio 6:12=1:2. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Worked Example: Angle Change
Shear matrix [[1,1],[0,1]] sends perpendicular basis vectors to (1,0) and (1,1), whose angle is 45 degrees rather than 90 degrees. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Worked Example: Area Change
A rectangle of area 10 under A with det A=-3 becomes a parallelogram of area 30 while orientation reverses. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Worked Example: Singular Map
A=[[1,0],[0,0]] collapses the plane onto the x-axis. Translation afterward can move that line but cannot restore lost y-information. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Worked Example: Homogeneous Form
Planar T(x,y)=(2x+y+4,3y-1) corresponds to homogeneous matrix [[2,1,4],[0,3,-1],[0,0,1]]. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Worked Example: Composition
Scale by two then translate by three differs from translate by three then scale by two: x↦2x+3 versus x↦2x+6. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Worked Example: Inverse Homogeneous Map
Invert A and use -A^{-1}b for the offset. Multiplying forward and inverse homogeneous matrices should return identity within numerical tolerance. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Worked Example: Affine Image Registration
Three ideal noncollinear source points and three matching destination points determine the six 2D affine parameters. A fourth point becomes a validation check rather than an additional degree of freedom. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Worked Example: Mean and Covariance
For y=Ax+b, E[y]=Aμ+b and Cov[y]=AΣA^T. Translation changes the centre but not spread relative to the centre. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Worked Example: Neural Layer
Layer y=Wx+b is affine. Two such layers without activation combine into y=W2W1x+(W2b1+b2), still affine. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Worked Example: Barycentric Interpolation
If point p=0.2v1+0.3v2+0.5v3 inside a triangle, its transformed point uses the same weights on transformed vertices under any affine map. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
Worked Example: Pixel to Map Coordinates
An affine raster geotransform converts pixel column and row into map easting and northing using origin, pixel-scale and possible rotation/shear coefficients. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
Worked Example: Local Deformation
A small square transformed by A=[[1.1,0.2],[0,0.9]] becomes a parallelogram. Translation b moves it without altering local strain. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Affine Transformation Verification Routine
Verify source and target dimensions, test at the origin to recover b, subtract transformed point pairs to isolate A, check determinant for invertibility and compare preserved affine relationships such as collinearity or barycentric coordinates. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Choosing Affine Versus Rigid
Use a rigid model when distances and angles should be preserved. Use affine only when unequal scale or shear is physically or numerically justified. Extra flexibility can fit calibration noise while reducing interpretability. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
Choosing Affine Versus Projective
Use projective models when perspective changes parallelism. Affine models are preferable when parallel structure should remain parallel and the simpler model fits residuals adequately. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
Common Affine Errors
Common mistakes include calling every affine map linear, forgetting that normals use inverse transpose, assuming angles are preserved, composing in the wrong order and fitting affine models to perspective distortion without checking residuals. In practical fitting, extra affine flexibility should be justified by residuals and by the physics or imaging geometry rather than used automatically.
A Practical Affine Checklist
Identify A and b, source and target frames, units, multiplication convention, determinant and rank. Decide which invariants the task requires and whether a rigid, affine or projective model matches those requirements. The underlying invariant is often more informative than the raw coordinates: affine maps preserve combinations whose coefficients sum to one.
How to Solve Affine Problems
Separate translation from the linear part, use homogeneous matrices for composition, invert with A^{-1}(y-b), and verify the result using known points and preserved affine relationships. When software conventions differ, define matrix direction and vector layout explicitly before composing transforms, because the same coefficients can be interpreted in opposite directions.
Internal Links for Affine Learning
Continue with What is a Linear Transformation?, What is a Translation? and What is a Coordinate Transformation?. Metric properties such as angle or length require stronger assumptions than affine geometry provides, so they should be verified rather than inferred from straight-line preservation.
Frequently Asked Questions About Affine Transformations
Are affine transformations linear? Only when b=0. Do they preserve parallel lines? Yes under invertible affine maps. Do they preserve circles? Not generally. Can they represent perspective? General perspective requires projective transformations. Numerical invertibility is also a conditioning question: a map with nonzero determinant can still amplify small errors dramatically along compressed directions.
What Is an Affine Transformation? The Complete Idea
An affine transformation is linear structure plus location. It preserves the relationships that depend on straightness, parallelism and affine combinations while allowing translation, unequal scale and shear across geometry, graphics, robotics, maps, data and optimisation. A useful check is to separate what happens to one point from what happens to a displacement; translation affects the former but cancels from the latter.
