
An affine space of dimension consists of a set of points and an associated vector space of dimension . It supports two operations:
- Point subtraction: (gives a vector)
- Point translation: (moves a point by a vector)
- Represent points at infinity (when ), as required for parallel lines in perspective projections.
- Express transformations such as perspective camera models and 3D projections as linear matrix operations.
Transformations in homogeneous coordinates
Homogeneous matrices represent common 2D transformations.Rigid transformation
A rigid transformation combines a rotation and a translation. It preserves lengths and angles and does not include scaling or shearing. Its matrix is- : rotation angle
- : translation
Similarity transformation
A similarity transformation includes rotation, translation, and uniform scaling. It preserves shape but not necessarily size. The scaling factor is .Affine transformation
An affine transformation can combine translation, rotation, scaling, and shearing. It preserves parallel lines, but it need not preserve lengths or angles. This matrix gives the general form of a 2D affine transformation.Example
The following code applies each transformation to a square:
References
- Hartley, R., Zisserman, A. (2004). Multiple View Geometry in Computer Vision.
Found an error on this page? Report an issue.

