Section 2 (Application to Geometry): Affine Transformations, Rigid Motions, Congruence, and Similarity Affine Transformations and Rigid Motions We define an affine transformation of Rn to be a mapping of the form FA,a(v)=Av+a, where v and a are column vectors of length n, and A is an nxn matrix. In particular, an affine transformation for which the matrix A is orthogonal is called a rigid motion. We say two subsets of R n are congruent if there is a rigid motion that maps one set onto the other. We note that FA,a(FB,b(v))=ABv + (Ab+a)=FAB,Ab+a(v), so that the composition of affine transformations is again an affine transformation. Moreover if A is invertible, then so is FA,a, and its inverse is FA-1, - A-1a. In particular, a rigid motion is invertible and its inverse is a rigid motion. Rigid motions respect both distance and angles. More specifically, Proposition 2.1: If F is a rigid motion of Rn, then ||F(v1)-F(v2)||=||v1-v2|| and (F(v2)F(v1))•(F(v3)-F(v1))=(v2-v1)•(v3-v1). If F is a rigid motion, then F=FA,a, where A is orthogonal. Since A is orthogonal, we have for all v, ||Av||2=(Av)•(Av)=v•v=||v||2, from which it follows that ||Av||=||v||. We also have, for any two vectors v 1 and v2, F(v1)-F(v2)=Av1+a-(Av2+a)=Av1-Av2=A(v1-v2). The proposition now follows easily. An affine transformation is a generalization of a linear transformation. The increased generality resides in the fact that a linear transformation always maps the zero vector to itself, while an affine transformation may not. Definition: The vectors v0, . . . , vn are said to be in general position if there do not n exist real numbers ao, ... , an, not all 0, for which ai vi 0 and i 0 n a i 0 i 0. The condition on the sum of the coefficients provides the distinction between the definition of linear independence and the slightly less restrictive definition of general position. The relationship is made more precise in the following proposition. Proposition 2.2: The vectors v0, . . . , vn are in general position if and only if the vectors v1-v0, .... , vn-v0 are linearly independent. If the vectors vi are not in general position, then there exist real numbers ao, ... , an, not all 0, for which n a v i 0 i i 0 and n a i 0 i 0 . It then follows that n a v i 0 i i n n ai v0 ai (vi v0 ) 0 . The i 1 i 0 converse argument is similar. The lower limit of summation may be changed from 0 to 1 because the first term in the last sum is identically 0. It follows from Proposition 2.2 that that up to n+1 vectors in an n dimensional vector space can be in general position, and that a set of vectors in general position can (but need not) include the zero vector. Proposition 2.3: Let v0, . . . , vn and w0, . . . , wn be sets of column vectors of length n. If the vi are in general position, there is a unique affine transformation F of R n for which F(vi)=wi for 0 i n . If the wi are also in general positition, then F is invertible. Instead of providing a formal proof, we will analyze an explicit example. We will define specific three dimensional vectors v0, . . . , v4 and w0, . . . , w4, and find the desired affine transformation with the help of MATLAB. v0=[1;1;1] v0 = 1 1 1 v1=[1;-1;1] v1 = 1 -1 1 v2=[1;2;3] v2 = 1 2 3 v3=[3;4;-5] v3 = 3 4 -5 w0=[0;0;1] w0 = 0 0 1 w1=[2;4;5] w1 = 2 4 5 w2=[3;-2;1] w2 = 3 -2 1 w3=[0;5;0] w3 = 0 5 0 We must now find the matrix that maps vi-v0 to wi-w0. We begin with the matrix A whose colums are viv0. Left multiplication by A maps the standard basis vectors to the columns of A and left multiplication by A-1 maps the columns of A to the standard basis vectors. Note that A-1 will exist if and only if the vi are in general position. A=[v1-v0,v2-v0,v3-v0] A = 0 -2 0 0 1 2 2 3 -6 Next, we obtain the matrix B whose columns are wi-w0. B=[w1-w0,w2-w0,w3-w0] B = 2 4 4 3 -2 0 0 5 -1 The matrix we want is BA-1 C=B*inv(A) C = 7.5000 5.5000 5.5000 -1.0000 -2.0000 -2.0000 2.0000 0 1.0000 Now the affine transformation we desire can be obtained in three steps: subtract v 0, multiply by C, and add w0. This prescription corresponds to FC,w0-Cv0. In order to accomplish this in MATLAB, we have written a MATLAB m-file to define a function of three variables called affine. affine(A,a,v) returns FA,a(v). We will define the appropriate transformation and check our work. c=w0-C*v0 c = -8.5000 -3.5000 -3.5000 affine(C,c,v0)-w0 affine(C,c,v1)-w1 affine(C,c,v2)-w2 affine(C,c,v3)-w3 ans = 0 0 0 ans = 0 0 0 ans = 0 0 0 ans = 0 0 0 We can now check whether the affine transformation we have defined is a rigid motion. C*C' ans = 61.2500 43.2500 45.2500 43.2500 34.2500 34.2500 45.2500 34.2500 35.2500 Since CCT is not the identity matrix, C is not orthogonal, and the affine transformation in question is not a rigid motion. Notice that in order to check this, we needed only the matrix C, and not the entire affine transformation. Because the wi are also in general position, C, and therefore the affine transformation, will be invertible. det(C) ans = -9.5000 Rigid Motions and Congruence We now make the connection with the usual definition of congruence for plane triangles, but first we will need a general proposition on orthogonal matrices. Proposition 2.4: Let A be an nxn matrix and v1, ... , vn a basis of the space of n dimensional column vectors. Suppose Avi•Avj=vi•vj for 0 i, j n . Then A is orthogonal. Proof: We need to show that A satisisfies the definition of orthogonality: Av•Aw=v•w for all v and w. We express both v and w as linear combinations of the vi and use the algebraic properties of the dot product. Proposition 2.5: Triangle v0v1v2 is congruent to triangle w0w1w2 in the usual Euclidean sense if and only if there is a rigid motion F of R2 with F(vi)=wi for 0 i 2. Proof: Since neither the vi nor the wi are collinear, it follows that both sets are in general position. It follows that there is a unique affine transformation F A,a with the desired properties. F is a rigid motion if and only if A is orthogonal. A typical side of the first triangle has squared length (vi-vj)•(vi-vj). The corresponding side of the second triangle has squared length (wi-wj)•(wi-wj)=A(vi-vj)•A(vi-vj). If A is unitary, these are equal; therefore corresponding sides of the two triangles have the same length and the triangles are congruent by SSS. To prove the converse, we observe that (v1-v0) and (v2-v0) form a basis for the space of two dimensional column vectors Moreover, (v1-v0)•(v2-v0)=||v1-v0|| ||v2-v0|| cos( ), where is the angle at v0, and similarly for the second triangle. It follows that if the two triangles are congruent, A satisfies the hypotheses of Proposition 2.4 and is orthogonal. Hyperplane Reflections We turn now to the subject of reflections. The reflection of any point (x,y,z) across the x y- plane in R3, for example is obtained by changing the sign of the z coordinate to obtain the point (x,y,-z). Reflection across the y axis in the R2 transforms the point (x,y) into the point (-x,y). In each case, the points of the "mirror" are fixed. More generally, if v is any none-zero vector of Rn, then its orthogonal complement v┴ is called a hyperplane and,since Pv Pv I , then for any vector w, we have Pv w Pv w w and we can define reflection in the mirror v┴ as the linear transformation whose matrix is Rv Pv Pv I 2 Pv 2 Pv I . Proposition 2.6: If v is a vector in Rn, then Rv is both symmetric and orthogonal, and satisfies Rv2 I , and Rv v v Proof: Rv is symmetric because both Pv and Pv are symmetric. Moreover Rv2 ( I 2Pv )2 4Pv2 4Pv I I . It follows that RvT Rv Rv1 , so that Rv is orthogonal. The last equality is immediate from the definition of Rv and the identity Pvv=v. Up to here, we have only discussed reflections whose "mirrors" are linear hyperplanes. We would like to extend our discussion to affine hyperplanes. The distinction is as follows. A linear hyperplane is the orthogonal complement of a fixed vector v, and consists of all those vectors w for which v w 0 . An affine hyperplane is more general in that it is characterized by the equation v w c for some constant c that is not necessarily 0. In particular, any line in the plane and any plane in three dimensional space is an affine hyperplane. We will define reflection in an affine hyperplane to be a rigid motion F such that F(w)=w if and only if w is on the hyperplane and F(F(w))=w for all w. Proposition 2.7: Let v be a fixed vector and c a fixed scalar. Then there is a unique reflection F in the affine hyperplane v w c , given by F FA,a , where A Rv and a 2c v. vv Proof: With A and a as given, we have F ( w) Rv w 2c wv 2c v w2 v v . Setting the vv vv vv right hand side of this equation to w gives precisely the equation of the hyperplane. We have F ( F ( w)) Rv ( Rv w 2c 2c v) v . Since Rv2 I and Rv v v , it follows that F(F(w))=w. vv vv Since Rv is orthogonal, it follows that F is a rigid motion and is the desired reflection. Now let us address the issue of uniqueness. Let w be any vector in Rn, and let w0 Pv w . Let G be any reflection in the hyperplane. If w is on the hyperplane, then w=w0=G(w). Otherwise, we have G(w0)=w0, ||G(w)-w0||=||w-w0||, and both w-w0 and G(w)-w0 are perpendicular to v , and are therefore multiples of v. It follows that the three points w, w0 and G(w) are collinear and w0 is the midpoint of the line segment whose endpoints are w and G(w). This determines G(w) uniquely; in particular, G(w) must be F(w) and the uniqueness of the reflection is established. Similarity Transformations and Similarity An affine transformation FA,a is called a similarity transformation if A is a non-zero scalar multiple of an orthogonal matrix. A similarity transformation is always invertible and its inverse is also a similarity transformation. Two subsets of Rn that are mapped to one another by similarity transformations are called similar. The following proposition provides a recognition principle for similarity transformations. Proposition 2.8: The square matrix A is a scalar multiple of an orthogonal matrix if and only if AAT is a positive scalar multiple of the identity matrix. Proof: If A=cU with U orthogonal, then AAT=c2UUT=c^2I. If AAT=c2I (any positive number is a square of a positive number), and we set U=(1/c)A. Then UUT=I , so that U is orthogonal and A=cU. We will see now how to construct similarity transformation in the plane. Proposition 2.9: In the two dimensional case, if v1 v2 and w1 w2 , there are exactly two similarity transformations mapping v1 to w1 and v2 to w2 . Instead of providing a proof of Proposition 2.9, we will carry out the construction for a specific example in a manner that should make it clear why the proposition is true in general. We begin by choosing our four points. v1=[1;3] v2=[2;-1] w1=[3;5] w2=[1;1] v1 = 1 3 v2 = 2 -1 w1 = 3 5 w2 = 1 1 We need, first, to construct an orthogonal transformation that will map v2-v1 to a positive multiple of w2w1. We begin by constructing two orthogonal matrices whose first columns are positive multiples, respectively, of v2-v1 and w2-w1. Gram-Schmidt orthogonalization will produce the matrices we want, provided we start with non-singular matrices whose first columns are respectively v2-v1 and w2-w1. The second column of each matrix can be any column vector that is obviously not a multiple of the first column. Instead of stepping through the Gram-Schmidt algorithm, we will invoke MATLAB's qr function. Av=[v2-v1,[0;1]] Av = 1 0 -4 1 [Uv,Rv]=qr(Av) Uv = -0.2425 0.9701 Rv = -4.1231 0 0.9701 0.2425 0.9701 0.2425 Aw=[w2-w1,[0;1]] Aw = -2 0 -4 1 [Uw,Rw]=qr(Aw) Uw = -0.4472 -0.8944 Rw = 4.4721 0 -0.8944 0.4472 -0.8944 0.4472 -Uv and Uw are the two orthogonal matrices we wanted. (For some reason, MATLAB's qr algorithm returned an orthogonal matrix whose first column is a negative instead of a positive multiple of v2-v1, it will be necessary to compensate for this on a case by case basis.) - U wU v 1 is now an orthogonal matrix that will map v2-v1 to a positive multiple of w2-w1. We must now take care of the scale factor. s=veclength(w2-w1)/veclength(v2-v1) s = 1.0847 We are now ready to define and check our affine transformation. A=-s*Uw*inv(Uv) A*(v2-v1)-(w2-w1) a=w1-A*v1 affine(A,a,v1)-w1 affine(A,a,v2)-w2 A = 0.8235 -0.7059 ans = 0 0 a = 0.0588 3.2353 ans = 0 0 ans = 1.0e-015 * -0.1110 0 0.7059 0.8235 It is geometrically clear that there is second similarity transformation with the desired properties, which can be obtained by reflecting the result of the first one across the line through w1 and w2. This can actually be obtained by changing the sign of the second column of either Uw or Uv (changing both will have no effect). Regular Polygons If we have a regular polygon with n vertices, then there is a rigid motion of the plane that permutes the vertices cyclically. The nth power of such a mapping fixes all n vertices, and must therefore be the identity. We can use the converse of this idea to build regular polygons. To illustrate the idea, let us build a regular seven-sided polygon. We will start by constructing an orthogonal matrix whose seventh power is the identity. A=[cos(2*pi/7),sin(2*pi/7);-sin(2*pi/7),cos(2*pi/7)] A = 0.6235 -0.7818 0.7818 0.6235 ans = 1.0000 0.0000 -0.0000 1.0000 A^7 Next we choose a vector, that will represent one vertex of our polygon, and we let the powers of A act on our first vertex to provide the others. For convenience in plotting, we assemble the coordinates of all these points into a matrix. P(1,1)=1; P(1,2)=0; for j=2:8 P(j,1:2)=P(j-1,1:2)*A'; end P Now we plot the polygon. plot(P(1:8,1),P(1:8,2)) axis equal Now let us consider a more general problem: Suppose we wish to construct a regular seven sided polygon two of whose vertices are (1,1,3)and (2,5,0). Since any polygon similar to a regular polygon is also regular, we will proceed by constructing a similarity transformation that takes two of the vertices of the polygon we have already constructed to (1,1,3) and (2,5,0). Then the image of our polygon under that similarity transformation will give us the polygon we desire. The detailed construction is left to an exercise. Problems: 1. Find the affine transformation F of R2 for which F(1,1)=(1.4,-.2), F(2,3)=(3.6,2), and F(5,4)=(6.2,-1.6) b. Use the result of part a to determine whether the triangle with vertices at (1,1), (2,3) and (5,4) is congruent to the triangle with vertices at (1.4,-.2), (3.6,.2) and (6.2,-1.6). Find the reflection of the point (1,2,7) in the hyperplane 3x-2y+6z=5. a. 2. 3. Determine whether the triangle with vertices at (0,0), (4,0) and (2,10) is similar to the triangle with vertices at (0,6),(6,0), and (18,18). Model your solution on what you did in Problem 3. 4. Construct a triangle with two vertices at (2,4) and (1,7) that is similar to the triangle with vertices at (2,2), (4,5) and (9,-10). How many such triangles are there? 5. Build and display a regular nine-sided polygon. 6. Build and display a regular seven-sided polygon with (1,1,3) and (2,5,0) as consecutive vertices.