4.7Affine geometry
Beyond 21-242 This section goes beyond the course.
The solution set of a linear system with is never a subspace, but by Proposition 3.1.19 it is the next best thing: the subspace , slid over so that it passes through one solution. Lines and planes that miss the origin are sets of this kind, and so is the screen of a computer, which has no preferred origin either. On such a set the sum of two points means nothing (the sum of two solutions of solves ), yet some combinations of points, such as midpoints, make perfect sense. This section finds out which combinations these are, and which maps respect them. Its last part, homogeneous coordinates, turns this affine geometry back into linear algebra one dimension up, which is how graphics software moves and projects three-dimensional scenes.
4.7.1Affine subspaces
Recall the translate
An affine subspace contains , so it is never empty. Some authors count as an affine subspace as well, which makes statements about intersections shorter; we will say “empty or an affine subspace” where it matters. We use the letters , , for affine subspaces and keep and for matrices.
- (a)Every subspace is an affine subspace, since . Every single point is one, since .
- (b)If the system has a solution , its solution set is an affine subspace of (Proposition 3.1.19). More generally, every nonempty fiber of a linear map is one (Corollary 2.6.31).
- (c)In , the line is
. - (d)In , the polynomials with form the fiber over of the linear map , so they form the affine subspace
. Here is the constant polynomial.
The vector in is not determined by , but the subspace is, and every point of can play the role of .
Proposition 4.7.3 (Direction and base points). Let be an affine subspace of .
- (a)
. In particular, if also for some and some subspace , then . - (b) for every .
- (c)For , the conditions , , and are equivalent.
Uses. Definition 4.7.1 (Affine subspace), Notation 3.1.17 (Translates), Definition 1.4.1 (Subspace)
Techniques. Double containment (Technique 1.3.14), Fix an arbitrary element and chase it (Technique 1.3.13)
(a) The points of are the vectors with . For two of them,
(b) Let , say with . For ,
because and lie in . So .
(c) If , then . If , then is a difference of two points of (as ), so it lies in by (a). If , then , and by (b). □
Technique 4.7.4 (Choose a base point). An affine subspace has no origin of its own, but by Proposition 4.7.3(b) any of its points can serve as one. Once a point is fixed, carries onto the subspace , and statements about become statements about , where linear algebra applies. Every point of works equally well, so choose the most convenient one, such as a point that two affine subspaces have in common, or a fixed point of a map.
Reach for it whenever an affine question has a linear counterpart that you already know how to answer. The canonical example is Proposition 4.7.10. The same move drives Theorem 4.7.14, Proposition 4.7.17, and Theorem 4.7.37.
Used in 10 places and 2 practice exercises
Corollary 4.7.6, Proposition 4.7.10, Theorem 4.7.14, Proposition 4.7.17, Proposition 4.7.20, Theorem 4.7.37, Proposition 4.7.38, Theorem 4.7.39, Theorem 8.4.31, Exercise 8.4.46; 2 practice exercises.
A subspace has direction , so its dimension is the same whether we regard it as a subspace or as an affine subspace. A line is a set
Uses. Proposition 4.7.3 (Direction and base points)
Techniques. Choose a base point (Technique 4.7.4)
So the translates of a subspace cut into disjoint parallel pieces, as the solution sets in Figure 3.1.4 do. They are the elements of the quotient space (Definition 4.6.20), which treats each translate as a single vector.
- (a)The unit circle
. If were an affine subspace, then would lie in by Proposition 4.7.3(a), and by (b). Then , which is false. - (b)The union of the lines and in . If were an affine subspace, then , so
would lie in . - (c)The three-point set
(Exercise 3.1.48).
Solution sets, revisited
Proposition 3.1.19 says that consistent linear systems have affine solution sets. With dimension theory we can now say how large they are, and show that every affine subspace of arises this way.
- (a)Let and . If the system is consistent, its solution set is an affine subspace of with direction and dimension .
- (b)Conversely, let be an affine subspace of of dimension . Then is the solution set of a system with , that is, of equations. No system of fewer than equations has solution set .
Uses. Proposition 3.1.19 (Solution sets are translates of the kernel), Corollary 4.2.23 (Dimension of solution sets), Proposition 4.4.16 (Complements exist), Theorem 4.4.19 (Dimension of a sum), Proposition 4.4.18 (Every subspace is a kernel and an image), Theorem 4.5.6 (Classification by dimension), Proposition 2.3.17 (Every linear map is some ), Theorem 4.2.7 (The image of ), Proposition 4.1.21 (Dimensions of subspaces)
Techniques. Particular plus homogeneous (Technique 3.1.18), Dimension counting (Technique 4.2.24)
(a) By Proposition 3.1.19, the solution set is for any solution , an affine subspace with direction . By Corollary 4.2.23(a),
(b) Write with , so . By Proposition 4.4.16, has a complement in . Since and , Theorem 4.4.19 gives . By Proposition 4.4.18 there is with and , and by Theorem 4.5.6 there is an isomorphism . The map , , is linear, and since is injective, if and only if . So . By Proposition 2.3.17, for some . Put . Then solves , and by Proposition 3.1.19 the solution set is
Finally, suppose is the solution set of a system with . By (a), . Since is a subspace of , Theorem 4.2.7 and Proposition 4.1.21 give
For this says that the hyperplanes of are exactly the solution sets of single equations
Example 4.7.9 (A line in as a solution set). Let be the line through with direction . By Theorem 4.7.8(b), two equations cut it out. We need of rank with . The rows must satisfy and be independent, so take and . Then , and is the solution set of
Indeed, the solution set contains , and its direction contains and has dimension , so it equals by Proposition 4.1.21(b).
Intersections
Uses. Proposition 4.7.3 (Direction and base points), Proposition 1.4.16 (Intersections of subspaces)
Techniques. Choose a base point (Technique 4.7.4), Fix an arbitrary element and chase it (Technique 1.3.13)
Suppose , and let . By Proposition 4.7.3(b), for every . For we have if and only if (if , then ; conversely ). Hence lies in every if and only if , that is,
By Proposition 1.4.16, is a subspace, so the intersection is an affine subspace, and its direction is by Proposition 4.7.3(a). □
The choice of base point was the whole proof: a point common to all the lets us write all of them as translates from one origin. Without such a point the intersection can be empty even when the directions have a large intersection, as for two distinct parallel lines. In two lines can also miss each other without being parallel, for example the -axis and ; such lines are called skew. Exercise 4.7.53 characterizes skew lines, and Exercise 4.7.52 explains why a plane has none.
4.7.2Affine combinations
Intuition (Which combinations make sense without an origin). Suppose we only know positions relative to some reference point , as on a screen or in a scene: the point has position . Combining positions with coefficients and converting the result back into a point gives
For two reference points and the results differ by , so the result does not depend on the reference point exactly when the coefficients add up to . These are the weighted averages of points. Combinations whose coefficients add up to are meaningful in a different way:
- (a)For and ,
. If , these points form the line through and . When in , the case is the midpoint . - (b)If in , the centroid is an affine combination. Over , three points have no centroid.
- (c), with coefficients , is the fourth vertex of the parallelogram with consecutive vertices : its differences with and with are and .
- (d)If for and , then
. So affine combinations of solutions are solutions, while the sum of two solutions is not.
Lemma 4.7.13 (Affine combinations do not depend on the origin). Let and .
- (a)If , then
. - (b)If , then
.
Uses. Lemma 1.3.9 (Arithmetic of linear combinations)
Subspaces are the nonempty sets closed under linear combinations. Affine subspaces have the analogous description.
Uses. Lemma 4.7.13 (Affine combinations do not depend on the origin), Proposition 4.7.3 (Direction and base points), Theorem 1.4.3 (Subspace criterion)
Techniques. Choose a base point (Technique 4.7.4)
() Let be an affine subspace, let , and let . Since , each lies in by Proposition 4.7.3(a). By Lemma 4.7.13(a),
() Suppose is nonempty and closed under affine combinations. Fix and put . Then , since each equals . We check the conditions of Theorem 1.4.3 for .
, since .
Scalar multiples. Let and . The vector is an affine combination of , so it lies in , and
Sums. Let . The vector is an affine combination of , with coefficients , so it lies in , and
So is a subspace, and is an affine subspace. □
The empty set has no affine combinations, because an empty list of coefficients adds up to , so .
Proposition 4.7.17 (The affine hull). Let be nonempty, and let .
- (a) is an affine subspace containing , and it is contained in every affine subspace that contains .
- (b)
. In particular, .
Uses. Theorem 4.7.14 (Affine subspaces are the sets closed under affine combinations), Lemma 4.7.13 (Affine combinations do not depend on the origin), Theorem 1.6.10 (Every spanning list contains a basis)
Techniques. Choose a base point (Technique 4.7.4)
(a) Each is the affine combination , so , and is nonempty. Let and . Each is an affine combination of finitely many elements of . Let list all elements of that occur in any of these combinations, and pad with zero coefficients, so that
So is closed under affine combinations, and it is an affine subspace by Theorem 4.7.14. If is an affine subspace with , then is closed under affine combinations by the same theorem, so it contains every affine combination of elements of , that is, .
(b) If , then Lemma 4.7.13(a) with gives
because the term with is . So
an affine combination of . Hence the two sets are equal. The direction is spanned by a list of length , which contains a basis (Theorem 1.6.10), so its dimension is at most . □
For two points , (b) gives
4.7.3Affine independence and barycentric coordinates
Definition 4.7.18 (Affine independence). A list in is affinely independent if the only scalars with
are . Otherwise the list is affinely dependent, and a relation of this form with some is an affine dependence.
- (a)A single point is affinely independent, since is forced by the coefficient sum. Two points are affinely independent if and only if : a relation with coefficients says .
- (b)The points of are affinely independent:
, so a relation has , and then . The list is linearly dependent, since it contains . - (c)The points are affinely dependent:
, and . They lie on one line.
An affine dependence is in particular a linear relation, so a linearly independent list is affinely independent; (b) shows that the converse fails. Unlike linear independence, affine independence does not change when all points are moved by the same vector : by Lemma 4.7.13(b) with ,
Proof (translate the relations).
Uses. Definition 4.7.18 (Affine independence), Theorem 1.5.5 (Independence is decided at zero), Lemma 4.7.13 (Affine combinations do not depend on the origin)
Techniques. Choose a base point (Technique 4.7.4)
() Suppose is affinely independent, and let
and the coefficients add up to . By affine independence they are all ; in particular . So the differences are linearly independent by Theorem 1.5.5.
() Suppose the differences are linearly independent, and let
The first approach singles out . The second treats all points alike, at the price of a larger space: it turns each point into a vector one dimension up, so that affine relations become linear relations. For a vector space , the set of pairs with the componentwise operations
Technique 4.7.21 (Homogenize: add a coordinate ). To turn an affine problem into a linear one without choosing a base point, replace each point by its lift in , or in if . Then
so the last coordinate records the coefficient sum. Affine combinations of points are the linear combinations of their lifts that land in the hyperplane “last coordinate ”, and affine dependences are the linear relations among the lifts. Row reduction, rank, and matrices then apply directly.
Reach for it when you want to treat all points symmetrically, or when you want affine maps to become matrix multiplication. The canonical example is the second approach to Proposition 4.7.20. Homogeneous coordinates (Section 4.7.6) apply the same idea to maps.
Used in 3 places and 1 practice exercise
Proposition 4.7.20, Theorem 4.7.42, Exercise 4.7.58; 1 practice exercise.
Proof (lift to one dimension higher).
Uses. Definition 4.7.18 (Affine independence), Proposition 1.5.18 (Operations that preserve independence), Theorem 1.5.5 (Independence is decided at zero)
Techniques. Homogenize: add a coordinate (Technique 4.7.21)
Let
so if and only if and . Thus the affine dependences of are exactly the nontrivial linear relations of , and the points are affinely independent if and only if their lifts are linearly independent.
Replacing by for , one at a time, does not change linear independence (Proposition 1.5.18(c)). The new list is
If
The second approach also gives a mechanical test. For points of , is affinely independent if and only if the matrix with columns has linearly independent columns, which row reduction decides (Theorem 3.5.12).
Theorem 4.7.22 (Characterizations of affine independence). Let . The following are equivalent.
- (I) is affinely independent.
- (II)
is linearly independent. - (III)
. - (IV)Every point of is an affine combination of in exactly one way.
- (V)No lies in the affine hull of the other entries of the list.
Uses. Proposition 4.7.20 (Affine independence through differences), Proposition 4.7.17 (The affine hull), Proposition 1.6.2 (Bases are independent spanning lists), Corollary 4.1.11 (Spanning lists are long)
Techniques. Proving TFAE (Technique 2.7.1), Uniqueness via two candidates (Technique 1.1.8), Contrapositive (Technique 1.5.4)
We prove (I) (II), (II) (III), (I) (IV), and (I) (V).
(I) (II) is Proposition 4.7.20.
(II) (III). By Proposition 4.7.17(b), the direction of is
(I) (IV). Suppose
(IV) (I). Suppose with . Then
are two affine combinations (their coefficients add up to and to ) that represent the point of the affine hull. By (IV) they have the same coefficients, so .
(I) (V). We show that (I) fails if and only if (V) fails. If
so lies in the affine hull of the other entries. □
Condition (V) is the affine form of the linear dependence lemma (Lemma 1.5.10), and (IV) is the affine form of unique coordinates. For , (V) holds because the other entries form an empty list, whose affine hull is empty.
Uses. Proposition 4.7.20 (Affine independence through differences), Theorem 4.1.10 (Independent lists are short)
Exercise 4.7.24. Decide whether each list is affinely independent. If it is not, find an affine dependence.
- (a)
in . - (b)
in . - (c)The same four points, read in .
Uses. Proposition 4.7.20 (Affine independence through differences)
(a) The differences from are and , which are linearly dependent, so the list is affinely dependent (Proposition 4.7.20). Translating
(b) The differences from are , , . If
(c) Over the step fails, and is a relation:
in , an affine dependence. The four points lie in the plane of .
Definition 4.7.25 (Affine frame, barycentric coordinates). Let be an affine subspace of . An affine frame of is an affinely independent list with
in exactly one way (Theorem 4.7.22(IV)). The scalars are the barycentric coordinates of with respect to .
The name comes from physics: if masses with total sit at , their center of mass, or barycenter, is .
Remark 4.7.26 (Frames exist, and coordinates are coordinates). Let with , and let be a basis of . Then
Barycentric coordinates are ordinary coordinates in disguise. By Lemma 4.7.13(a),
So
Example 4.7.27 (Barycentric coordinates in a triangle). Let , , in . The differences and are independent, so the three points form an affine frame of , a triangle. For , Remark 4.7.26 asks for
For , the equations and give , , and . Check:
Homogenizing (Technique 4.7.21) gives the same numbers in one step: is the unique solution of
whose columns are the lifts .
When , Remark 4.7.26 says that are the coordinates of in the basis , so the change-of-basis component of Section 4.5 also shows barycentric coordinates. Read its two basis vectors as two vertices of a triangle whose third vertex is .
If in , the point whose barycentric coordinates are all is the centroid . Over a triangle has no centroid, and Exercise 4.7.57 shows what its medians do instead.
4.7.4Convexity and simplices
Over we can ask for barycentric coordinates to be nonnegative, which describes the solid triangle rather than the plane it spans. Throughout this subsection is a real vector space; everything works verbatim over .
Proposition 4.7.30 (Convex sets and convex hulls). Let be a real vector space, and let .
- (a)A subset is convex if and only if every convex combination of elements of lies in .
- (b) is convex, contains , and is contained in every convex subset of that contains .
Uses. Definition 4.7.28 (Convex combination, convex set, convex hull), Proposition 4.7.17 (The affine hull)
Techniques. Induction on the length of a list (Technique 1.6.9)
(a) If contains every convex combination of its elements, then in particular it contains for and , so is convex. Conversely, let be convex. We show by induction on that every convex combination of elements of lies in . For , and the combination is . Let , and assume the claim for . If , then with all , so and the combination is . Otherwise
is a convex combination of elements of (its coefficients are nonnegative and add up to ), so by the induction hypothesis. Then
which lies in because is convex and .
(b) Each is the convex combination , so . Let and . As in the proof of Proposition 4.7.17(a), write and over one list of elements of , padding with zero coefficients. Then
and the coefficients are nonnegative and add up to . So is convex. If is convex and , then contains every convex combination of elements of by (a), that is, . □
Definition 4.7.31 (Simplex). Let be affinely independent in a real vector space . The -simplex with vertices is
Indexing the coordinates of from , the standard -simplex is
the simplex whose vertices are the standard basis vectors of .
A -simplex is a point, a -simplex is a segment, a -simplex is a solid triangle, and a -simplex is a solid tetrahedron. The points of are the probability vectors with entries. For instance, a classifier that assigns probabilities to classes outputs a point of , and stochastic matrices (Section 11.1) have columns in .
Uses. Definition 4.7.31 (Simplex), Theorem 4.7.22 (Characterizations of affine independence), Definition 4.7.25 (Affine frame, barycentric coordinates)
Techniques. Uniqueness via two candidates (Technique 1.1.8)
In Example 4.7.27, lies in the triangle, since its coordinates are positive, and does not. Renderers test whether a pixel lies in a triangle exactly this way. They also use the coordinates to shade it: if the vertices carry colors (red, green, and blue intensities), the pixel at gets
Carathéodory’s theorem
A point of may be given as a convex combination of many points of . In , though, every point of a convex polygon lies in a triangle formed by three of its vertices. In general a long convex combination can be shortened: when the points it uses are affinely dependent, the dependence gives a way to change the coefficients without changing the point or the coefficient sum, and we change them until one coefficient reaches .
Technique 4.7.33 (Slide along a dependence). Suppose , where the coefficients are subject to constraints, such as and , and the satisfy a relation that respects the equality constraints (here ). Then
Reach for it to show that a representation can be chosen short, for instance using independent vectors only. It refines the argument of Theorem 1.6.10, where a redundant vector is simply discarded, to situations where the coefficients must keep their signs. The canonical example is Carathéodory’s theorem (Theorem 4.7.34).
Used in 2 places
Uses. Definition 4.7.28 (Convex combination, convex set, convex hull), Corollary 4.7.23 (Affinely independent lists are short), Definition 4.7.18 (Affine independence)
Techniques. Slide along a dependence (Technique 4.7.33), Extremal choice and minimal counterexamples (Technique 1.5.9)
Let . Among all ways of writing as a convex combination of finitely many elements of , choose one,
Since the add up to and are not all , at least one of them is positive. Let
attained at . Then . Put . Then
If , then ; if , then , so
The bound cannot be lowered. Let be the vertex set of an -simplex. Its centroid has all barycentric coordinates positive, while a convex combination of fewer vertices has a zero coordinate, so by the uniqueness in Proposition 4.7.32 the centroid is not a convex combination of fewer than points of .
4.7.5Affine maps
In Section 2.1, the maps were the basic non-examples of linear maps (Non-example 2.1.12), and Proposition 2.1.13 showed that, when , they respect exactly the affine combinations. They are the maps of affine geometry.
The pair is determined by :
- (a)Linear maps (), constant maps (), and translations (with ) are affine.
(b)The rotation of by the angle about a point moves to the origin, rotates, and moves back:
where is the rotation about (Section 2.1). Its linear part is wherever the center is. Likewise the scaling by about is
. - (c)The map on is not affine, since it sends to , and is the midpoint of and while is not the midpoint of and . (Affine maps preserve midpoints, by the next theorem.)
Theorem 4.7.37 (Affine maps preserve affine combinations). Let be a map. The following are equivalent.
- (I) is affine.
- (II)
for all , all , and all with . - (III)For every , the map ,
, is linear. - (IV)For some , the map is linear.
In that case is the linear part of for every .
Uses. Proposition 2.1.13 (Which combinations an affine map respects), Theorem 2.1.3 (Checking linearity)
Techniques. Proving TFAE (Technique 2.7.1), Choose a base point (Technique 4.7.4)
We prove (I) (II) (III) (IV) (I).
(I) (II). If , then by Proposition 2.1.13,
(II) (III). Fix and write . For , the vector
For ,
So is linear by Theorem 2.1.3.
(III) (IV) holds because is nonempty.
(IV) (I). Let be linear. For ,
So with , and is affine.
Finally, if , then for every and ,
Compare Exercise 2.1.39, which assumed only that respects affine combinations of two points and needed to recover additivity. The three-point combination with coefficients makes the division by unnecessary, exactly as in the proof of Theorem 4.7.14.
Proposition 4.7.38 (Affine maps and affine subspaces). Let be affine.
- (a)If is affine, then is affine, and
. - (b) is bijective if and only if is. In that case is affine, and
. - (c)If is an affine subspace of , then is an affine subspace of with direction . If is finite-dimensional, then .
- (d)If is an affine subspace of , then is empty or an affine subspace of with direction .
Uses. Definition 4.7.35 (Affine map), Proposition 2.1.17 (Compositions of linear maps are linear), Proposition 2.7.7 (Bijective linear maps are invertible), Proposition 4.7.3 (Direction and base points), Proposition 2.6.8 (Kernels and images are subspaces), Theorem 4.2.11 (Rank–nullity), Theorem 1.4.3 (Subspace criterion)
Techniques. Choose a base point (Technique 4.7.4)
(a)
(b) The translation , , is a bijection with inverse , and . If is bijective, so is ; if is bijective, so is . In that case , that is,
(c) Let . For ,
(d) Let and
Over , condition (II) of Theorem 4.7.37 applied to convex combinations shows that an affine map sends segments onto segments, convex sets to convex sets, and onto . It also preserves ratios along a line: if , then
Theorem 4.7.39 (Affine maps are determined by a frame). Let be an affine frame of , and let be arbitrary. There is exactly one affine map with for , namely
Uses. Theorem 4.7.37 (Affine maps preserve affine combinations), Definition 4.7.25 (Affine frame, barycentric coordinates), Proposition 4.7.17 (The affine hull), Theorem 4.7.22 (Characterizations of affine independence), Theorem 2.2.1 (Linear maps are determined by a basis)
Techniques. Choose a base point (Technique 4.7.4), Construct a map by choosing it on a basis (Technique 2.2.4)
Uniqueness and the formula. Let be affine with for all . Every
Existence. By Proposition 4.7.17(b), with
an affine map. Then , and
Example 4.7.40 (Mapping one triangle onto another). The affine map with , , has translation part and linear part with and :
By Theorem 4.7.39, sends the point with barycentric coordinates with respect to , which is , to the point with the same barycentric coordinates with respect to the triangle of Example 4.7.27. For instance
4.7.6Homogeneous coordinates
A graphics program moves objects by rotations, scalings, and translations, composed in long chains, and applies the result to every vertex of the scene. Composites of linear maps are products of matrices, which can be computed once and reused. A translation is not linear, so a chain such as “rotate about a point, then translate” is not a single matrix in . Homogenizing (Technique 4.7.21) repairs this.
The last claim holds because forces and . For example, and are both vectors of homogeneous coordinates of . The vectors of homogeneous coordinates of are the nonzero vectors on the line through in , so matches the points of with the lines through in that are not contained in the hyperplane . Vectors with last coordinate represent no point of ; the aside at the end of the section says what they represent instead.
Theorem 4.7.42 (Affine maps as matrices). Let be affine, with and , and let
where is the zero row.
- (a) for every , and is the only matrix in with this property.
- (b) is a bijection from the set of affine maps onto the set of matrices in whose last row is .
- (c)If is affine, then .
- (d)If , then is bijective if and only if is invertible, and in that case .
Uses. Theorem 2.4.34 (Block multiplication), Proposition 4.7.38 (Affine maps and affine subspaces), Proposition 2.3.17 (Every linear map is some ), Corollary 2.2.6 (Agreeing on a spanning list), Theorem 2.3.20 (Linear maps correspond to matrices), Corollary 3.5.25 (The invertible matrix theorem)
Techniques. Homogenize: add a coordinate (Technique 4.7.21), Block decomposition (Technique 2.4.35)
(a) By Theorem 2.4.34, with blocks of sizes and ,
For uniqueness, note that and for , so the vectors span . If for all , then the linear maps and agree on a spanning list, so they are equal (Corollary 2.2.6), and (Theorem 2.3.20).
(b) By Proposition 2.3.17, the linear part of an affine map is for exactly one , so each affine map is for exactly one pair , since the linear part and are determined by . The matrices with last row are exactly the with and , and each of them determines . So is a bijection.
(c) Let . By Theorem 2.4.34,
and by Proposition 4.7.38(a), is
(d) Note that
The translation by has matrix . On it is a linear map, a shear that slides the hyperplane along itself by and fixes the hyperplane . For : the map
Exercise 4.7.43. Let be invertible and . Verify by block multiplication that
Use it to invert the matrix of the translation by , and the matrix .
Uses. Theorem 2.4.34 (Block multiplication), Theorem 2.5.10 (Left and right inverses agree)
By Theorem 2.4.34,
and
For the translation, and , so the inverse is , the matrix of the translation by .
For the matrix, and . Since , , and
Example 4.7.44 (Rotation about a point). Let be the rotation of by counterclockwise about , and . By Example 4.7.36, , so by Theorem 4.7.42(c),
The last column is
The order of the factors matters. The product
is the matrix of “translate by , then rotate about ”, which is , a rotation about a different center.
In three dimensions the same matrices are . A renderer stores each object once, in coordinates convenient for that object, and places it in the scene by a product of rotations, scalings, and translations, computed once per object. Each vertex then costs one matrix–vector product, which is why graphics processors are built around matrix arithmetic. In the product, acts first.
Perspective projection
The projection
The points of the line through and are for . The third coordinate of such a point is , which is if and only if . If , there is no such : the line is parallel to the image plane, or , and has no image. Otherwise , and the first two coordinates are and , so
The same formula covers points on the far side of the image plane from the center, and points on the far side of the center from the image plane, where .
The map is not affine. With , and
Proposition 4.7.45 (Perspective projection in homogeneous coordinates). Let and
For every with ,
Uses. Definition 2.3.8 (Matrix–vector product), Definition 4.7.41 (Homogeneous coordinates)
The nonlinearity has moved into the freedom of Definition 4.7.41: does not have last coordinate , and the division by the last coordinate, performed once at the very end, supplies it. The matrix has rank , so the depth is lost. Renderers therefore use the third row instead of , which keeps the number
For a center off the -axis, or another image plane, conjugate by translations and rotations as in Example 4.7.44; Exercise 4.7.49 carries this out. Under , parallel lines in space usually stop being parallel, as the rails of a track do in a photograph, and Exercise 4.7.50 finds where their images meet.
Aside (Projective space). By Definition 4.7.41, a point of is the same thing as a line through in , namely , and every line through that is not contained in the hyperplane arises this way exactly once. The projective space is the set of all lines through in , that is, of all -dimensional subspaces. Its elements are the points of together with the lines inside , called points at infinity. A point at infinity , with , corresponds to a direction in . Over , the points of a line have the vectors of homogeneous coordinates and for , and the latter tend to as . So all lines with direction share one point at infinity, and in Exercise 4.7.50 the vanishing point of a family of parallel lines is the image of their common point at infinity under .
A projective line is a -dimensional subspace of , viewed as the set of lines through that it contains. In the projective plane , two distinct projective lines meet in exactly one point: by Proposition 4.1.21(b), so is larger than and equals , and Theorem 4.4.19 gives
Exercises
Exercise 4.7.46. Decide which of the following sets are affine subspaces. For each one that is, find its direction and, if it is finite, its dimension.
- (a)The solution set in of and .
- (b)The set of with and .
- (c)The set of with .
- (d)The set of with .
Uses. Theorem 4.7.8 (Affine subspaces of are solution sets), Theorem 4.7.14 (Affine subspaces are the sets closed under affine combinations), Proposition 4.7.3 (Direction and base points), Corollary 2.6.31 (Fibers are translates of the kernel)
(a) Yes. The homogeneous equations , give , so their solutions are . One solution of the system is : and . By Theorem 4.7.8(a), the set is
(b) Yes. The map ,
(c) No. The points , , lie in the set, and the affine combination
(d) No. In , , , and , so the set is . The affine combination
Uses. Remark 4.7.26 (Frames exist, and coordinates are coordinates), Proposition 4.7.32 (Barycentric coordinates on a simplex)
The differences and are independent, so the points form an affine frame of . By Remark 4.7.26, since , a point has
For : , , . All are positive, so lies in the triangle (Proposition 4.7.32). Check:
For : , , . So is outside, beyond the edge opposite . Check:
For : , , . So is outside, beyond the edge opposite . Check:
Exercise 4.7.48. Work in with homogeneous coordinates.
- (a)Write the matrices of the translation by , the rotation by counterclockwise about , and the scaling by the factor about .
- (b)Compute and , and describe each product as a map of .
- (c)Which point of has as a vector of homogeneous coordinates? Give a vector of homogeneous coordinates of the same point with last entry .
Uses. Theorem 4.7.42 (Affine maps as matrices), Example 4.7.36 (Affine maps), Definition 4.7.41 (Homogeneous coordinates)
(a) By Theorem 4.7.42, the matrix of is . The scaling about is
(b) Multiplying,
By Theorem 4.7.42(c), the first is the matrix of , which rotates and then translates: . The second is , which translates and then rotates:
(c) By Definition 4.7.41, represents . Multiplying by gives .
Exercise 4.7.49. Let and , and let be the perspective projection onto the plane with center .
(a)Show that for with ,
- (b)Let and let be the projection with center . Show that
. - (c)Compute the matrix , with as in Proposition 4.7.45, and check that it sends to a vector of homogeneous coordinates of .
Uses. Proposition 4.7.45 (Perspective projection in homogeneous coordinates), Theorem 4.7.42 (Affine maps as matrices), Definition 4.7.41 (Homogeneous coordinates)
(a) The line through and consists of the points , whose third coordinate is . It vanishes exactly for , which exists since . The first coordinate is then
and the second is in the same way.
(b)
Adding , the first coordinate becomes
(c) With
(In the second product, row is row plus times row of , and similarly for row .) This matrix sends to . The last entry is nonzero, and dividing by it gives first coordinate
Exercise 4.7.50. Let , and let and be as in Proposition 4.7.45. Let with , and let
- (a)Suppose , and let
. Show that is a vector of homogeneous coordinates of , and that for every with , the point lies on . Conclude that the images of all lines with direction lie on lines (or points) through the single point , the vanishing point of the direction . - (b)Suppose . Show that maps the line onto the line
. So lines parallel to the image plane have parallel images.
Uses. Proposition 4.7.45 (Perspective projection in homogeneous coordinates), Definition 4.7.41 (Homogeneous coordinates), Proposition 4.7.17 (The affine hull)
(a)
using
(b) If , then , and every point of the line has third coordinate . So
As runs over , so does , and the image is the line
Uses. Theorem 4.7.14 (Affine subspaces are the sets closed under affine combinations), Proposition 4.7.17 (The affine hull)
Techniques. Finding counterexamples and minimal examples (Technique 1.4.18)
The answer depends on . Over the statement is false: in , the points and are affine subspaces, neither contains the other, and their union is a subspace.
Now suppose has more than two elements, and choose with and . Suppose is affine but neither of contains the other. Pick with , and with . The point is an affine combination of elements of , so it lies in by Theorem 4.7.14.
If , then
an affine combination of , so , a contradiction. If , then
an affine combination of (the coefficients add up to ), so , a contradiction. Hence, when , the statement is true. The argument breaks down over exactly because the line through and has no third point.
Uses. Proposition 4.7.10 (Intersections of affine subspaces), Theorem 4.4.19 (Dimension of a sum), Proposition 4.1.21 (Dimensions of subspaces), Corollary 4.7.6 (Parallel affine subspaces are equal or disjoint)
Techniques. Dimension counting (Technique 4.2.24)
Let and , both of dimension , and suppose and are not parallel, so . If , then by Proposition 4.1.21(b), which is not the case. So some vector of lies outside , and . Then
Pick and , and write with and . Then lies in and in . By Proposition 4.7.10, is an affine subspace with direction , and by Theorem 4.4.19,
For , the hyperplanes are lines. Two lines in a plane are either parallel, or they meet in an affine subspace of dimension , a single point.
Uses. Proposition 1.5.14 (Appending a vector), Theorem 4.1.10 (Independent lists are short), Definition 4.7.5 (Direction, dimension, parallel)
The lines meet if and only if for some , that is, if and only if for some , that is, if and only if .
The lines are parallel if and only if . Since , this holds if and only if for some (necessarily nonzero), that is, if and only if is linearly dependent: a nontrivial relation must have , as both vectors are nonzero.
So are disjoint and not parallel if and only if is independent and . By Proposition 1.5.14, this is equivalent to the independence of . (If is dependent, so is the longer list, and both sides fail.)
If , no list of three vectors is independent (Theorem 4.1.10), so two lines are never disjoint and non-parallel.
Uses. Proposition 4.7.17 (The affine hull), Theorem 4.7.8 (Affine subspaces of are solution sets), Proposition 4.1.21 (Dimensions of subspaces)
By Proposition 4.7.17(b), the hull is
A row
Its solution set is an affine subspace containing with direction of dimension , which contains ; so the direction is by Proposition 4.1.21(b), and the solution set is the hull. Check the other points: , , and , .
Exercise 4.7.55. Let satisfy
Show that is affine. (Over the same hypothesis does not imply that is affine; the counterexamples need a basis of over , see Section 15.1.)
Uses. Theorem 2.1.3 (Checking linearity), Definition 4.7.35 (Affine map)
Let
With this says . Applying that to ,
So is additive. By induction on , for integers (the case is , and
so . Hence is additive and homogeneous over , so it is linear by Theorem 2.1.3, and is affine.
Exercise 4.7.56. Find the error in the following argument, and decide which half of the claim is true.
Claim. A list in is affinely independent if and only if it is linearly independent.
Proof. An affine dependence is a linear relation, so if the list is linearly independent, it is affinely independent. Conversely, let be a linear relation, and put . Replacing by gives coefficients that add up to , so an affinely independent list has
Uses. Definition 4.7.18 (Affine independence), Example 4.7.19 (Affine independence)
The first half is correct: an affine dependence is a nontrivial linear relation, so a linearly independent list has none.
The error is in the converse. After is replaced by , the combination represents
which is not unless or . So the new coefficients are not an affine dependence, and affine independence says nothing about them. (The last sentence of the argument is also confused, but the claim fails before it.)
The converse is false. The list in consists of two distinct points, so it is affinely independent (Example 4.7.19(a)), but it contains , so it is linearly dependent. Likewise is affinely independent and linearly dependent (Example 4.7.19(b)).
Exercise 4.7.57. Let be affinely independent in . When , the median from is the line through and the midpoint of the other two vertices.
- (a)Suppose and in . Show that the three medians are distinct lines that all pass through the centroid
, and that is their only common point. - (b)Now let and . Show that the three medians are parallel and pairwise disjoint, and that together they contain every point of .
Uses. Theorem 4.7.22 (Characterizations of affine independence), Proposition 4.7.17 (The affine hull), Corollary 4.7.6 (Parallel affine subspaces are equal or disjoint), Proposition 4.7.3 (Direction and base points), Proposition 4.1.34 (Size of a vector space over a finite field)
(a) Write , and similarly . Then
an affine combination of and , so lies on the median from (Proposition 4.7.17), and likewise on the other two. The median from is a line, since : otherwise would be an affine combination of , contradicting Theorem 4.7.22(V).
Suppose two medians coincide, say those from and (the other cases are the same up to renaming). Then lies on the median from , so this median is , and it contains . Then is an affine combination of points of , so it lies there, contradicting Theorem 4.7.22(V). So the medians are three distinct lines. Two distinct lines meet in at most one point: their intersection is empty or an affine subspace of dimension at most (Proposition 4.7.10), and if it had dimension it would equal both lines (Proposition 4.1.21(b) applied to the directions, and Proposition 4.7.3). So is the only common point.
(b) In , , so , and , where
Suppose two of them coincide, say for some (by Proposition 4.7.3(c)). Then
with coefficient sum , and the coefficients are not all (that would need , , and ). This is an affine dependence, a contradiction. So the three medians are distinct parallel lines, hence pairwise disjoint (Corollary 4.7.6). Each has points, so together they have points (Proposition 4.1.34), and they cover .
- (a)Find the affine map with , , , and its matrix .
- (b)Find the affine map with , , .
- (c)Let be affinely independent in , let , and let have columns and . Show that is invertible and that the affine map with has matrix . Check (b) this way.
Uses. Theorem 4.7.39 (Affine maps are determined by a frame), Theorem 4.7.42 (Affine maps as matrices), Proposition 4.7.20 (Affine independence through differences), Corollary 3.5.25 (The invertible matrix theorem), Proposition 2.4.8 (Four views of the product)
Techniques. Homogenize: add a coordinate (Technique 4.7.21)
(a) By Theorem 4.7.39 there is exactly one such map. Its translation part is , and its linear part has
(b) The affine map
Check:
(c) The columns of are the lifts , which are linearly independent by the second approach to Proposition 4.7.20. So is invertible (Corollary 3.5.25). Let be the affine map with (Theorem 4.7.39). By Theorem 4.7.42(a), for each , which says that column by column (Proposition 2.4.8). Hence . For (b),
in agreement with (b).
Exercise 4.7.59. (Radon’s theorem.) Let . Show that the index set can be split into two disjoint nonempty parts and with
Find such a split for the four points
Uses. Corollary 4.7.23 (Affinely independent lists are short), Definition 4.7.28 (Convex combination, convex set, convex hull)
Techniques. Slide along a dependence (Technique 4.7.33)
By Corollary 4.7.23, the points are affinely dependent: there are , not all , with and . Let and . Since the add up to and are not all , some is positive and some is negative, so and are nonempty. Let ; then . Moving the terms with to the other side of the dependence and dividing by ,
On the left, the coefficients are positive and add up to ; on the right, they are nonnegative and add up to . So lies in both convex hulls.
For
Exercise 4.7.60. A function of the form
- (a)Show that no affine has , , , and . (The labels of these four points form the “exclusive or” pattern.)
- (b)Show that after adding the feature , that is, after replacing each point by
, there is an affine with positive at and negative at .
Uses. Theorem 4.7.37 (Affine maps preserve affine combinations)
(a) Suppose such an affine exists. The point is the affine combination , and also . By Theorem 4.7.37(II),
a contradiction. In words, the segment between the two positive points crosses the segment between the two negative points, and at the crossing point an affine function would have to be both positive and negative.
(b) The four points become , , , and . Let
Uses. Theorem 4.7.14 (Affine subspaces are the sets closed under affine combinations)
Techniques. Induction on the length of a list (Technique 1.6.9)
() If is affine, then
() Every coefficient in is or , so an affine combination of elements of is the sum of those with , and their number is odd, because the coefficients add up to in . We show by induction on that a sum of elements of (repetitions allowed) lies in . For it is a single element of . For , the sum
The first set consists of the vectors with , and each of its triples sums to a vector with the same property, so it passes the test; it is in fact a subspace. The second consists of the vectors with , and the sum of three such vectors has coordinate sum , so it passes too: it is the affine plane
- (a)Using matrices, compute the composite of the rotation by counterclockwise about followed by the rotation by counterclockwise about . Show that it is a rotation by , and find its center.
- (b)More generally, let be an affine map of whose linear part is the rotation by an angle that is not a multiple of . Show that has exactly one fixed point , and that is the rotation by about .
Uses. Theorem 4.7.42 (Affine maps as matrices), Example 4.7.36 (Affine maps), Proposition 2.5.28 (Inverse of a matrix), Proposition 3.1.19 (Solution sets are translates of the kernel)
(a) Let . The rotation about has matrix . The rotation about is (Example 4.7.36), with
the map . Its fixed points solve , so , and
(b) A fixed point is a solution of , that is, of , where
Here
the rotation by about . Part (a) is the case , .
Exercise 4.7.63. Let be a field with elements, and let .
- (a)Show that the number of -dimensional affine subspaces of is times the number of -dimensional subspaces of .
- (b)Count the lines in and the planes in .
Uses. Proposition 4.7.3 (Direction and base points), Corollary 4.7.6 (Parallel affine subspaces are equal or disjoint), Proposition 4.1.34 (Size of a vector space over a finite field), Proposition 4.1.37 (Counting subspaces)
Techniques. Double counting (Technique 4.1.36)
(a) By Proposition 4.7.3(a), each affine subspace has exactly one direction, so the -dimensional affine subspaces are grouped by their directions, which are the -dimensional subspaces of . Fix such a . By Corollary 4.7.6, the distinct translates of are pairwise disjoint and every vector lies in one of them. Each translate is in bijection with via , so it has elements (Proposition 4.1.34). Since , there are exactly translates of . Summing over gives the claim.
(b) By Proposition 4.1.37, has one-dimensional subspaces, so it has lines. And has
Exercise 4.7.64. Let and be real vector spaces, and let satisfy
That is, maps each segment onto a segment, at constant speed. Show that is affine.
Uses. Exercise 2.1.39, Definition 4.7.35 (Affine map)
We first show that the identity holds for all . Let and . Then
and , so the hypothesis gives
If , then
Now let
Since in , Exercise 2.1.39(a) shows that is linear. Hence is affine.
Uses. Proposition 4.7.32 (Barycentric coordinates on a simplex), Theorem 4.7.22 (Characterizations of affine independence)
Let have vertices , and write points of in barycentric coordinates (Proposition 4.7.32). The vertex has coordinates , with in place and elsewhere.
Vertices are extreme. Suppose
Other points are not extreme. Let have coordinates and not be a vertex. The are nonnegative and add up to , and they are not a standard basis vector, so at least two of them are positive, say with . Let
The extreme points are defined in terms of the set alone, so determines its vertex set. In particular, a -simplex is not a -simplex for .
More practice
The practice bank has 16 exercises on this section’s topics.