










































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











































































Inner Product Spaces 475
478 Section 27. The Dot Product in R right in Figure 27.1 we have hidden the parts of the polygons that we cannot see from our view. We Figure 27.1: Images of a house. also see this idea in mathematics when we graph surfaces. Figure 27.2 shows the graph of the sur-p face defined by f(x; y) = 4 x 2 that is made up of polygons. At left we see all of the polygons and at right only those parts that would be visible from our viewing perspective. By eliminating 2 2 z (^) z 1 1 -2 - 0 x 0 x 0 0 (^0) y 2 0 y 2 Figure 27.2: Graphs of f(x; y) = p (^4) x^2. the parts of the polygons we cannot see from our viewing perspective, the computer program can more quickly render the viewing image. Later in this section we will explore one method for how programs remove the hidden portions of images. This process involves the dot product of vectors. Introduction Orthogonality, a concept which generalizes the idea of perpendicularity, is an important concept in linear algebra. We use the dot product to define orthogonality and more generally angles between vectors in R n for any dimension n. The dot product has many applications, e.g., finding components of forces acting in different directions in physics and engineering. The dot product is also an example of a larger concept, inner products, that we will discuss a bit later. We introduce and investigate dot products in this section. We will illustrate the dot product in R^2 , but the process we go through will translate to any
Section 27. The Dot Product in R dimension. Recall that we can represent the vector v = v 1 as the directed line segment (or ar- v 2 row) from the origin to the point (v 1 ; v 2 ) in R 2 , as illustrated in Figure 27.3. Using the Pythagorean Theorem we can then define the length (or magnitude or norm) of the vector v in R^2 as jjvjj = q : v 1 2
. The dot product (or scalar product) of u and v is the scalar X^ n u v = u 1 v 1 + u 2 v 2 + + unvn = uivi: i= The dot product then allows us to define the norm (or magnitude or length) of any vector in Rn. Definition 27.2. The norm jjvjj of the vector v 2 R n is p jjvjj = v v: We also use the words magnitude or length as alternatives for the word norm. We can equiva-lently write the norm of the vector v = [v 1 v 2 vn] T as q jjvjj = v 1 2
Section 27. The Dot Product in R The Distance Between Vectors Finding optimal solutions to systems is an important problem in applied mathematics. It is often the case that we cannot find an exact solution that satisfies certain constraints, so we look instead for the “best” solution that satisfies the constraints. An example of this is fitting a least squares line to a set of data. As we will see, the dot product (and inner products in general) will allow us to find “best” solutions to certain types of problems, where we measure accuracy using the notion of a distance between vectors. Geometrically, we can represent a vector u as a directed line segment from the origin to the point defined by u. If we have two vectors u and v, we can think of the length of the difference u v as a measure of how far apart the two vectors are from each other. It is natural, then to define the distance between vectors as follows. Definition 27.5. Let u and v be vectors in R n
. The distance between u and v is the length of the difference u v or jju vjj: As Figure 27.4 illustrates, if vectors u and v emanate from the same initial point, and P and Q are the terminal points of u and v, respectively, then the difference jju vjj is the standard Euclidean distance between the points P and Q. Q v u − v u P Figure 27.4: jju vjj. The Angle Between Two Vectors Determining a “best” solution to a problem often involves finding a solution that minimizes a dis-tance. We generally accomplish a minimization through orthogonality – which depends on the angle between vectors. Given two vectors u and v in R n , we position the vectors so that they emanate from the same initial point. If the vectors are nonzero, then they determine a plane in R n . In that plane there are two angles that these vectors create. We will define the angle between the vectors to be the smaller of these two angles. The dot product will tell us how to find the angle between vectors. Let u and v be vectors in R n and the angle between them as illustrated in Figure 27.5. Using the Law of Cosines, we have jju vjj 2 = jjujj 2
482 Section 27. The Dot Product in R v u − v θ v Figure 27.5: The angle between u and v By rearranging, we obtain
jj jj jj jj 1 jj jj 2 jj jj 2 jj jj 2 = (jjujj + jjvjj (u v) (u v)) 2 =^1 (jjujj^2 + jjvjj^2 u u + 2u v v v) 2 = u v : So the angle between two nonzero vectors u and v in R n satisfies the equation cos( ) = u v : (27.1) jjujj jjvjj Of particular interest to us will be the situation where vectors u and v are orthogonal (perpen- dicular). 2 Intuitively, we think of two vectors as orthogonal if the angle between them is 90. Activity 27.1. (a) The vectors e 1 = [1 0] T and e 2 = [0 1] T are perpendicular in R 2
. What is e 1 e 2? (b) Now let u and v be any vectors in R n . i. Suppose the angle between nonzero vectors u and v is 90. What does Equation (27.1) tell us about u v? ii. Now suppose that u v = 0. What does Equation (27.1) tell us about the angle between u and v? Why? iii. Explain why the following definition makes sense. Definition 27.6. Two vectors u and v in R n are orthogonal if u v = 0. iv. According to Definition 27.6, to which vectors is 0 orthogonal? Does this make sense to you intuitively? Explain. Activity 27.2. (^2) We use the term orthogonal instead of perpendicular because we will be able to extend this idea to situations where we normally don’t think of objects as being perpendicular.
484 Section 27. The Dot Product in R To summarize: Definition 27.7. Let u and v be vectors in R n with v 6=0. (1) The orthogonal projection of u onto v is the vector projvu = u v^ v:^ (27.2) jjvjj 2 (2) The projection of u orthogonal to v is the vector proj?vu = u projvu: 5 and v = 10 6
. Find projvu and proj?vu and draw a picture to Activity 27.4. (^) Let u = (^8) illustrate. Orthogonal Complements In Activity 27.1 we defined two vectors u and v in R n to be orthogonal (or perpendicular) if u v = 0. With this in mind we can define the orthogonal complement of a subspace of R n . Definition 27.8. Let W be a subspace of R n for some n 1. The orthogonal complement of W is the set W ? = fx 2 R n : x w = 0 for all w 2 W g: Preview Activity 27.2. Let W = Spanf[1 1]Tg in R 2 . Completely describe all vectors in W ? both algebraically and geometrically. The orthogonal projection of a vector u onto a vector v is really a projection of the vector u onto the vector space Spanfv g. The vector projvu is the best approximation to u of all the vectors in Spanfvg in the sense that projvu is the closest to u among all vectors in Spanfvg, as we will prove later. Another familiar example where we see this type of behavior is when we look at planes in 3- space. Remember that a plane through the origin in R 3 is a two dimensional subspace of R 3 . We define a plane through the origin to be the set of all vectors in R^3 that are orthogonal to a given vector (called a normal vector). For example, to find the equation of the plane through the origin in R 3 orthogonal to the normal vector n = [1 2 1]T, we seek all the vectors v = [x y z]T^ such that v n = 0: This gives us the equation x + 2y z = 0 as the equation of this plane. There is a more general idea here as defined in Preview Activity 27.2. If we have a set S of vectors in R n , we let S ? (read as “S perp”, called the orthogonal complement of S) be the set of all vectors in R n that are orthogonal to every vector in S. In our plane example, the set S is fng and S ? is the plane with equation x + 2y z = 0.
Section 27. The Dot Product in R Activity 27.5. We have seen another example of orthogonal complements. Let A be an m n matrix with rows r 1 , r 2 , : : :, rm in order. Consider the three spaces Nul A, Row A, and Col A related to A, where Row A = Spanfr 1 ; r 2 ; : : : ; rmg (that is, Row A is the span of the rows of A). Let x be a vector in Row A. (a) What does it mean for x to be in Row A? (b) Now let y be a vector in Nul A. Use the result of part (a) and the fact that Ay = 0 to explain why x y = 0. (Hint: Calculate Ay using scalar products of rows of A with y.) Explain how this verifies (Row A) ? = Nul A. (c) Use AT in place of A in the result of the previous part to show (Col A) ? = Nul AT. The activity proves the following theorem: Theorem 27.9. Let A be an m n matrix. Then (Row A) ? = Nul A and (Col A) ? = Nul A T : To show that a vector is in the orthogonal complement of a subspace, it is not necessary to demonstrate that the vector is orthogonal to every vector in the subspace. If we have a basis for the subspace, it suffices to show that the vector is orthogonal to every vector in that basis for the subspace, as the next theorem demonstrates. Theorem 27.10. Let B = fw 1 ; w 2 ; : : : ; wm g be a basis for a subspace W of R n
. A vector v in R n is orthogonal to every vector in W if and only if v is orthogonal to every vector in B. Proof. Let B = fw 1 ; w 2 ; : : : ; wmg be a basis for a subspace W of Rn^ and let v be a vector in R n . Our theorem is a biconditional, so we need to prove both implications. Since B W , it follows that if v is orthogonal to every vector in W , then v is orthogonal to every vector in B. This proves the forward implication. Now we assume that v is orthogonal to every vector in B and show that v is orthogonal to every vector in W. Let x be a vector in W. Then v = x 1 w 1 + x 2 w 2 + + xmwm for some scalars x 1 , x 2 , : : :, xm. Then v x = v (x 1 w 1 + x 2 w 2 + + xmwm) = x 1 (v w 1 ) + x 2 (v w 2 ) + + xm(v wm) = 0: Thus, v is orthogonal to x and v is orthogonal to every vector in W. < 1 3 2 Activity 27.6. Let W = Span 82 1 ; : 4 5 4
(^0 39). Find all vectors in W ?. 5 1 ; We will work more closely with projections and orthogonal complements in later sections.
Section 27. The Dot Product in R T (^) = P Q = [x x y y ]T^ ax + by + c = 0 (c) Recall that n = [a b] and v! 1 0 1 0. Since 1 1 , we have projnv = v v^ n jjnjj^2 = a(x 1 x 0 ) + b(y 1 y 0 )^ [a b]T a 2
. (In fact, W is a plane through the origin in R 3 .) (b) Find a vector n that is orthogonal to the two vectors you found in part (a). (c) Explain why fng is a basis for W ? . Example Solution. (a) The coefficient matrix for the system ax + by + cz = 0 is [a b c]T. The first column is a pivot column and the others are not. So y and z are free variables and [x y z]T^ = ay^ T (^) = y a 1 0 T (^) a 0 1 i (^) : az; y; z + z h b c b c T So W = Span n (^) ab^ 1 0 T^ ;^ a c 0 1 T o . (b) If we let n = [a b c] T , then n (^) a 1 0 T= b + b = 0 b n h c^ 0 1 i T = c + c = 0: a Thus, [a b c] T is orthogonal to both b (^) 1 0 T (^) and c (^) 0 1 a a T.
(^488) Section 27. The Dot Product in Rn (c) Let u = b^ 1 0 T^ and v = c^ 0 1 T. Every vector in W has the form xu + yv for a (^) some scalars x and y, and a n (xu + yv) = x(n u) + y(n v) = 0: So n 2 W ? . Now we need to verify that fng spans W ?
. Let w = [w 1 w 2 w 3 ] T be in W ? . Then w z = 0 for every z 2 W. In particular, w u = 0 or (^) a b w 1 + w 2 = 0, and w v = 0 or a c w 1 + w 3 = 0. Equivalently, we have w 2 = (^) a b w 1 and w 3 = (^) a c w 1. So v = [w 1 w 2 w 3 ]T =w 1 aw (^1) aw 1 T b c = (^1) [a b c]Tw 1 a = w a 1 n: So every vector in W?^ is a multiple of n, and fng spans W ?. We conclude that fng is a basis for W ? . Thus, the vector [a b c] T is a normal vector to the plane ax + by + cz = 0 if a 6= 0. The same reasoning works if at least one ofa, b,or c is nonzero, so we can say in every case that [a b c] T is a normal vector to the plane ax + by + cz = 0. Summary The dot product of vectors u = [u 1 u 2 un] T and v = [v 1 v 2 vn] T in R n is the scalar X^ n u v = u 1 v 1 + u 2 v 2 + + unvn = uivi: i= The angle between two nonzero vectors u and v in R n satisfies the equation cos( ) = u v jjujj jjvjj and 0180. Two vectors u and v are orthogonal if u v = 0. p The length, or norm, of the vector u can be found as jjujj = (^) u u. The distance between the vectors u and v in R n is jju vjj, which is the length of the difference u v. Let u and v be vectors in R n .
490 Section 27. The Dot Product in R (b) Must it be true that if u and v are vectors in R n with jju + vjj 2 = jjujj 2
Section 27. The Dot Product in R (f) True/False If v is a vector in R n and v v = 0, then v = 0. (g) True/False The norm of the sum of vectors is the sum of the norms of the vectors. (h) True/False If u and v are vectors in R n , then projvu is a vector in the same direction as u. (i) True/False The only subspace W of R n for which W ? = f0g is W = R n . (j) True/False If a vector u is orthogonal to v 1 and v 2 , then u is also orthogonal to v 1 + v 2. (k) True/False If a vector u is orthogonal to v 1 and v 2 , then u is also orthogonal to all linear combinations of v 1 and v 2. (l) True/False If u 6=0 and v are parallel, then the orthogonal projection of v onto u equals v. (m) True/False If u 6=0 and v are orthogonal, then the orthogonal projection of v onto u equals v. (n) True/False For any vector v and u 6=0, jjprojuvjj jjvjj. (o) True/False Given an m n matrix, dim(Row A) + dim(Row A) ? = n. (p) True/False If A is a square matrix, then the columns of A are orthogonal to the vectors in Nul A. (q) True/False The vectors in the null space of an m n matrix are orthogonal to vectors in the row space of A. Project: Back-Face Culling To identify hidden polygons in a surface, we will utilize a technique called back face culling. This involves identifying which polygons are back facing and which are front facing relative to the viewer’s perspective. The first step is to assign a direction to each polygon in a surface. Project Activity 27.1. Consider the polygon ABCD in Figure 27.8. Since a polygon is flat, every vector in the polygon is perpendicular to a fixed vector (which we call a normal vector to the polygon). A normal vector n for the polygon ABCD in Figure 27.8 is shown. In this activity we learn how to find a normal vector to a polygon. Let x = [x 1 x 2 x 3 ] T and y = [y 1 y 2 y 3 ] T be two vectors in R 3
. If x and y are linearly independent, then x and y determine a polygon as shown in Figure 27.8. Our goal is to find a vector n that is orthogonal to both x and y. Let w = [w 1 w 2 w 3 ]T^ be another vector in R^3 and let (^2) wT 3 v = 4 x T 5 be the matrix whose rows are w, x, and y. Let Cij be the ijth cofactor of C, that y T is Cij is (1) i+j times the determinant of the submatrix of C obtained by deleting the ith row and jth column of C. Now define the vector x y as follows: x y = C 11 e 1 + C 12 e 2 + C 13 e 3 :
Section 27. The Dot Product in R n C n D