The geometry of the dot product

Một phần của tài liệu Shimamoto d multivariable calculus 2019 (Trang 23 - 27)

That is, let S: Rm → Rp and T:Rn → Rm be linear transformations with matrices A and B, respectively, with respect to the standard bases. Then S ◦T is a linear transformation, and its matrix with respect to the standard bases is the productAB.

Example 1.9. Let T:R2 →R2 be the counterclockwise rotation by π3 about the origin, S:R2 → R2the reflection in thex1-axis, and consider the compositionS◦T (first rotate, then reflect). Using the matrices from (1.5) and (1.6), the matrix of S◦T with respect to the standard bases is the product:

1 0 0 −1

" 1

2 −

√ 3

√ 2 3 2

1 2

#

=

"

1ã12 + 0ã

√3

2 1ã(−

√3

2 ) + 0ã12 0ã12+ (−1)ã

√ 3

2 0ã(−

√ 3

2 ) + (−1)ã12

#

=

"

1

2 −

√3 2

√ 3 2 −12

# .

Working backwards and looking at the columns of this matrix, this tells us that (S◦T)(e1) = (12,−

√3

2 ) = (cos(−π3),sin(−π3)) and (S◦T)(e2) = (−

√3

2 ,−12) = (cos(7π6 ),sin(7π6 )). These points are plotted in Figure1.7. A linear transformation that has the same effect one1 ande2 is the reflection

Figure 1.7: The composition of a rotation and a reflection

in the line` that makes an angle of −π6 with the positive x1-axis. But linear transformations are completely determined by what they do to the standard basis: two transformations that do the same thing must be the same transformation. Thus we conclude that S◦T is the reflection in `.

This can be verified with geometric reasoning as well.

By comparison, the composition T ◦S (first reflect, then rotate) is represented by the same matrices multiplied in the opposite order:

" 1

2 −

√ 3

√ 2 3 2

1 2

#

1 0

0 −1

=

"

1 2

√3

√ 2 3 2 −12

#

. (1.9)

Note that this is different from the matrix of S ◦T. Matrix multiplication need not obey the commutative lawAB=BA. (Can you describe geometrically the linear transformation that (1.9) represents?)

1.5 The geometry of the dot product

We now discuss some geometric properties of the dot product, or, perhaps more accurately, how the dot product can be used to develop geometric intuition aboutRn whennis large enough to be outside direct experience.

Definition. The norm, or magnitude, of a vector x = (x1, x2, . . . , xn) in Rn, denoted kxk, is defined to be:

kxk= q

x21+x22+ã ã ã+x2n. For instance, in R3, ifx= (1,2,3), then kxk=√

1 + 4 + 9 =√ 14.

The following simple property gets used a lot.

Proposition 1.10. If x∈Rn, then xãx=kxk2. Proof. Both sides equalx21+x22+ã ã ã+x2n.

We return to the familiar setting of the plane and examine these notions there. For instance, if x = (x1, x2), then kxk = p

x21+x22. By the Pythagorean theorem, this is the length of the hypotenuse of a right triangle with legs|x1|and|x2|. If we think ofxas an arrow emanating from the origin, thenkxkis the length of the arrow. If we think of xas a point, thenkxkis the distance from xto the origin.

Given two points x and y in R2, the distance between them is the length of the arrow that connects them, −yx→=x−y. Hence:

Distance betweenxand y=kx−yk.

Next, letx= (x1, x2) andy= (y1, y2) be nonzero elements ofR2, regarded as arrows emanating from the origin. Suppose that the arrows are perpendicular. If x and y do not form a horizon- tal/vertical pair, then the slopes of the lines through the origin that contain them are defined and are negative reciprocals. The slope is the ratio of vertical displacement to horizontal displacement, so this gives xx2

1 = −yy1

2. See Figure 1.8. This is easily rearranged to become x1y1 +x2y2 = 0, or

Figure 1.8: Perpendicular vectors in the plane: for instance, note thatxhas slope x2/x1. xãy = 0. If x and y do form a horizontal/vertical pair, say x = (x1,0) and y = (0, y2), then xãy= 0 once again. Conversely, if xãy= 0, the preceding reasoning can be reversed to conclude thatx and yare perpendicular. Thus:

In R2,xand yare perpendicular if and only if xãy= 0.

For vectors in the plane in general, let θ denote the angle between two given vectors x and y, where 0≤θ≤π. To study the relationship between the dot product andθ, assume for the moment that neitherx nory is a scalar multiple of the other, soθ6= 0, π, and consider the triangle whose

1.5. THE GEOMETRY OF THE DOT PRODUCT 13

Figure 1.9: Vectors xand y inR2 and the angle between them

vertices are0,x, andy. Two of the sides of this triangle have lengthskxkandkyk, and the length of the third side is the length of the arrow −yx→=x−y. See Figure1.9. Thus by the law of cosines, kx−yk2 =kxk2+kyk2−2kxk kyk cosθ. By Proposition 1.10, this is the same as:

(x−y)ã(x−y) =xãx+yãy−2kxk kyk cosθ. (1.10) Multiplying out the left-hand side gives (x−y)ã(x−y) =xãx−xãy−yãx+yãy=xãx−2xãy+yãy.

This expansion uses some of the elementary, but obvious, algebraic properties of the dot product that we declined to list. After substitution into (1.10), we obtain:

xãx−2xãy+yãy=xãx+yãy−2kxk kyk cosθ.

Hence after some cancellation:

xãy=kxk kyk cosθ. (1.11) In the case that xory is a scalar multiple of the other, thenθ= 0 or π. Say for instance that y=cx. Thenxãy=xã(cx) =ckxk2. Meanwhile,kyk=|c| kxk, sokxk kykcosθ=|c| kxk2cosθ=

±ckxk2cosθ. The plus sign occurs when|c|=c, i.e., the scalar multiplecis nonnegative, in which case θ = 0 and cosθ= 1. The minus sign occurs when c <0, whence cosθ = cosπ =−1. Either way, the relationship (1.11) continues to hold. Thus (1.11) is valid for allx,y inR2.

We use our knowledge of the plane to try to create some intuition about Rn whenn≥3. This is especially important when n > 3, since visualization in those spaces is almost completely an act of imagination. For instance, if v is a nonzero vector in Rn, we think of the set of all scalar multiplescvas a “line.” Ifwis a second vector, not a scalar multiple ofv, andcand dare scalars, the parallelogram law of addition suggests that the combination cv+dw should lie in a “plane”

determined byvand wand that, as cand drange over all possible scalars,cv+dwshould sweep out this plane. As a result, the set of all vectors cv+dw, where c, d ∈ R, is called the plane spannedbyvandw. We denote it by P. The only reason that it’s a plane is because that’s what we have chosen to call it.

We would like to make P into a replica of the familiar plane R2. We sketch one approach for doing this, without filling in many technical details. We begin by choosing two vectorsu1 and u2 in P such that u1ãu1 =u2ãu2 = 1 and u1ãu2 = 0. These vectors play the role of the standard basis vectorse1 ande2, which of course satisfy the same relations. (It’s not hard to show that such vectors u1 and u2 exist. In fact, in terms of the spanning vectors v and w, one can check that u1 = kvk1 v andu2= kzk1 z, wherez=w−vãwvãvv, is one possibility, though there are many others.) We useu1andu2to establish a two-dimensional coordinate system internal toP. Every element ofP can be written in the formx=a1u1+a2u2for some scalarsa1 anda2. In terms of our budding intuition, we think ofp

a21+a22 as representing the distance from the origin, or the length, ofx.

If y=b1u2+b2u2 is another element ofP, then:

xãy= (a1u1+a2u2)ã(b1u1+b2u2)

=a1b1u1ãu1+ (a1b2+a2b1)u1ãu2+a2b2u2ãu2

=a1b1+a2b2.

Thus the dot product in Rn agrees with the result we would expect in terms of the newly created internal coordinates in P. In particular, kxk2 =xãx=a21+a22, so the norm in Rn represents our intuitive notion of length in P. This is true even though the coordinates ofx= (x1, x2, . . . , xn) in Rn don’t really have anything to do withP.

Continuing in this way, we can build upP as a copy ofR2 and transfer over the familiar concepts of plane geometry, such as distance and angle. The following terminology reflects this intuition.

Definition. A vector x inRn is called a unit vectorifkxk= 1.

For example, the standard basis vectors ei = (0,0, . . . ,0,1,0, . . . ,0) are unit vectors.

Corollary 1.11. If x is a nonzero vector in Rn, then u = kxk1 x is a unit vector. It is called the unit vector in the direction of x.

Proof. We calculate thatuãu= kxk1 x

ã kxk1 x

= kxk12 xãx

= kxk12kxk2= 1. Thus by Proposition 1.10,kuk= 1.

Our main result in this section is that the relation between the dot product and angles that we derived for the plane in equation (1.11) is true inRn for all n.

Theorem 1.12. If x and y are vectors in Rn, then:

xãy=kxk kyk cosθ, where θ is the angle between x and y in the plane that they span.

Proof. The case that x ory is a scalar multiple of the other is proved in the same way as in R2. Otherwise,x and y span a plane P, and the points 0, x, and y form a “triangle” in P. Since we can makeP into a geometric replica ofR2, the law of cosines remains true, and, since the norm in Rn represents length inP, this takes the form:

kx−yk2=kxk2+kyk2−2kxk kyk cosθ.

From here, the argument is identical to the one forR2.

Lastly we introduce the standard terminology for the case of perpendicular vectors, that is, when θ= π2, so cosθ= 0.

Definition. Two vectors xand y inRn are called orthogonal ifxãy= 0.

For instance, the standard basis vectors inRn are orthogonal: eiãej = 0 whenever i6=j.

Một phần của tài liệu Shimamoto d multivariable calculus 2019 (Trang 23 - 27)

Tải bản đầy đủ (PDF)

(326 trang)