Академический Документы
Профессиональный Документы
Культура Документы
Appendix B
A B = AB cos
(B.1)
where is the angle between A and B. Since the dot product AB cos has only a magnitude and not a direction, then A B is a scalar quantity. The dot product A B = AB cos can be written as A B = ( A cos ) B where A cos is the magnitude of the projection of A on B as shown in Fig. B.1.
A cos B
Appendix B
The dot product can also be written as A B = A ( B cos ) where B cos is the magnitude of the projection of B on A as shown in Fig. B.2.
B cos A
B
Figure B.2 A B = A ( B cos )
From the definition of the dot product, A B = AB cos and B A = BA cos . It is therefore clear that A B = B A and the commutative law holds for the scalar product. The distributive law A ( B + C ) = A B + A C also holds and is illustrated for the special case shown in Fig. B.3 where D = B + C.
y A C D
x B
Figure B.3 A ( B + C ) = A B + A C
Then
A ( B + C) = A D
A j i
Figure B.4 Dot product in a rectangular coordinate system
B x
B = Bx i + By j . Then
A B = ( Ax i + Ay j) ( Bx i + By j) = Ax Bx i i + Ay Bx j i + Ax By i j + Ay By j j
Since the unit vectors i and j are orthogonal (i.e., perpendicular), then from the definition of the scalar product i i = j j = 1 and i j = j i = 0. Thus, the scalar product can be written as
A B = Ax Bx + Ay By
(B.2)
Note that the dot product A B must always involve the product of two vectors, and since the result is a scalar, then an expression such as A ( B C ) has no meaning. On the other hand the expression A ( B C ) does have a meaning.
Appendix B
A i = Ax A j = Ay A k = Az
Consider the definition of the dot product A B = AB cos . If B = A, then A A = A2 .
B.4 Example B1
Given the vectors A = i 2 j + 4k and B = 3i + j 2k find A B .
Answer 1:
Answer 2: In Matlab the dot product of vectors A and B can be written as dot(A,B) as shown in Matlab Example B1.
Matlab Example B1 >> A = [1 -2 4] A = 1 -2 4
>> B = [3 1 -2] B = 3 1 -2
B.5 Example B2
Find the angle between the vectors A and B in Example B1.
Answer 1:
A B = AB cos = 7
A = 21 B = 14 AB 7 cos = = = 0.408 AB 21 14 = 114
Answer 2: In Matlab the solution can be found by writing the single Matlab equation shown in Matlab Example B2.
Matlab Example B2 >> A = [1 -2 4] A = 1 -2 4
>> B = [3 1 -2] B = 3 1 -2
Note carefully the need to use parentheses in the equation for phi. The Matlab function acos for the arc cosine gives the answer in radians. Thus, that result must be multiplied by 180/ to give the answer in degrees.
Appendix B
Problems
Where appropriate use Matlab to find the answers to the following problems. B-1 Given the vectors A = 3i 4 j 2k and B = 2i + j 5k find (a) Find A B and B A . (b) Find the smaller angle between A and B. (c) What is the component of A in the direction of B? (d) What is the component of B in the direction of A? B-2 If A = 10i + 5 j 2k , determine A2. B-3 Given the vectors A = 3i 2 j + 5k and B = 2i + 8 j + 2k show that A and B are perpendicular to each other. B-4 A i = 3, A j = 5, and A k = 2 . Find A. z B-5 If A = i + 3j 2k and B = 4i j + 2k find, ( 2 A + B ) ( A 2B ) . B-6 For what values of are vectors A = i 2 j + k and B = 2 i + j 4k perpendicular?