An affine transformation is a type of geometric transformation which preserves collinearity (if a collection of points sits on a line before the transformation, they all sit on a line afterwards) and the ratios of distances between points on a line. Types of affine transformations include translation (moving a figure), scaling (increasing or decreasing the size of a figure), and rotation (turning a figure about a point).
Note that affine transformations can be done , for , although some of the transformations do not make sense for . Matrix algebra will be used to unify the presentation. To get an unique affine transformation matrix, one more point is needed than the of the space. It also is assumed that the points do not share a common space. For example, in space, 3 points are required and they must not all in in the same space, that is, must not be collinear.
The examples and computations will be in . Hopefully the extension to will be obvious.
In each example, the before is red and solid and the after is blue and dashed. The corners of the example triangle will be labeled as follows: the first will have a small disk, the second will have a small quadrilateral and the third vertex will have a small five-sided object. All of these labels will be in translucent gray. The original triangle will be (0,0), (1,0) and (0,1), in each example.
Right by and up by
By vertically. By definition, scaling is in one direction only. Note, multiple scaling on more than axis is permissible and in on all axes, becomes a magnification or homothety..
A reflection about an infinite line passing through with a slope of :
A rotation about the origin through an angle of radians:
Shearing or shear
A shearing about the origin through an angle of radians:
Affine transformations become linear transformations in one dimension higher. By assigning a point a next coordinate of , e.g., becomes , these are called homogeneous coordinates. Since linear transformations are represented easily by matrices, the corresponding entity is an augmented matrix, where the s provide all transformation except translation and those are represented by the s.
The example sets of points are the original set and the final set.
The original set are , and ,. In a matrix, that becomes:
The desired final set is , and . In a matrix, that becomes:
Therefore, the affine transformation matrix is the of .
That can be solved for by . Note the following, because matrix multiplication is not commutative, i. e., the multiplicands may not swap sides, the inverse of has to go to the side of that was on on previously. Since, in this article, column vectors and left side matrix multiplication is being used by convention, that means that would go to the right side of . Also, note that if will not invert, that means the original points are in a common subspace, e.g., are collinear in the case of 2D, coplanar in the case of 3D, etc.
The reverse transformation is matrix inverse of the forward transformation:
Each frame of the movie is of the total affine transformation from all to none and back again.