Lab 2 Dot Product Cross Product
Lab 2 Dot Product Cross Product
net/publication/373999608
CITATIONS READS
0 149
1 author:
Eugene Marchuk
Innopolis University
48 PUBLICATIONS 51 CITATIONS
SEE PROFILE
All content following this page was uploaded by Eugene Marchuk on 21 September 2023.
Dot product
Cross product
Scalar triple product
Solution.
The dot product operation is:
a · b = |a| · |b| cos α
Then:
√ √
|a|2 − 2 3a · b − 7|b|2 = |4|2 − 2 3 · |4| · |1| · cos 150◦ − 7 · |1|2
√
2
√ 2
√ 3
|a| − 2 3a · b − 7|b| = 16 − 2 3 · 4 · 1 · (− )−7
√ 2
|a|2 − 2 3a · b − 7|b|2 = 21
q.e.d.
2 of 24
Dot Product
Example.
1 −5
Find the angle between a= 1 and b= 1 .
1 −1
Solution.
a·b
α = cos−1
|a| · |b|
Then:
a · b = (1 · (−5) + 1 · 1 + 1 · (−1)) = −5
p q
|a| · |b| = 2 2
1 +1 +1 · 2 2 2 2
(−5) + 1 + (−1) = 9
−1 −5
α = cos
9
q.e.d. 3 of 24
Dot Product
Example.
All three vectors a, b and c have length of 3 and a + b + c = 0. Find
a·b+b·c+c·a
Solution.
The idea of solution was kindly suggested by Timur Usmanov.
4 of 24
Dot Product
According to given conditions:
|a| = |b| = |c| = 3, a+b+c=0
After substitution we have:
|0|2 = |3|2 + |3|2 + |3|2 + 2 · (a · b + b · c + a · c)
Then:
|3|2 + |3|2 + |3|2
a·b+b·c+a·c=−
2
27
a·b+b·c+a·c=−
2
q.e.d.
Solution.
xc
Let us denote c= yc and write other given conditions in the sense
zc
of analytical geometry:
6 of 24
Dot Product
p
x 2 + yc2 + zc2 = 1 2 2 2
c xc + yc + zc = 1√
q
−1 b·c
cos |b|·|c| = cos −1 2 2
⇒ b · c = |b| · |c| · √27
27
a·c=0
a · c = 0
2 2 2 2 2 2
xc + yc + zc = 1
√ xc + yc + zc = 1
√
5 · xc + 1 · yc + 1 · zc = 2 ⇒ 5 · xc + 1 · yc + 1 · zc = 2
1 · xc − 1 · yc + 1 · zc = 0 xc + zc − yc = 0
2 2 2 2 2 2
xc + yc + zc = 1
√ xc + yc√+ zc = 1
5 · xc + 1 · (xc + zc ) + 1 · zc = 2 ⇒ xc2 = ( 62 − z3c )2
2
yc = xc + zc yc = (xc + zc )2 7 of 24
Dot Product
Substituting 2nd and 3rd equations into the 1st one we have:
√ √
2 zc 2 2 2zc 2
( − ) +( + ) + zc2 = 1
6 3 6 3
√ √
2 2 zc zc2 2 2 zc 4z 2
−2 + + +2·2 + c + zc2 − 1 = 0
36 6 3 9 36 √ 6 3 9
14 2 2 8
z + zc − = 0
9 c 9 9
Solving quadratic equation:
√
4 2
z1 = −
√7
2
z2 =
2
8 of 24
Dot Product
Then: √ √ √
2 4 2 15 2
xc1 = + =
6 21 42
√ √
2 2
xc2 = − =0
6 6
and: √ √ √
15 2 8 2 2
yc1 = − =
42 42 6
√ √
2 2
yc2 = 0 + =
2 2
q.e.d.
9 of 24
Dot Product
In many applications it is necessary to decompose a vector into the
sum of two perpendicular vector components. Perpendicular vectors
have a dot product of zero and are called orthogonal vectors.
Solution.
Step 1. Find the projection p onto q.
p·q
projq p = ·q
|q|2
(1 · 1 + 2 · (−2)) + 3 · 2) 1 1 2 2
projq p = p ·q= ·q= ;− ;
| 12 + (−2)2 + 22 |2 3 3 3 3
1 2 2
projq p = ;− ;
3 3 3
11 of 24
Cross Product
Step 2. Find the orthogonal component.
q⊥ = p − projq p
1 2 2 2 8 7
q⊥ = 1 − ; 2 − (− ); 3 − = ; ;
3 3 3 3 3 3
Step 3. Write the vector as the sum of two orthogonal vectors.
1 2 2 2 8 7
p = projq p + q⊥ = ;− ; + ; ; = (1; 2; 3)
3 3 3 3 3 3
Step 4. Check the solution.
1 2
3 3
− 2 · 8 = 1 · 2 − 2 · 8 + 2 · 7 = 0
3 3 3 3 3 3 3 3
2 7
3 3
12 of 24
q.e.d.
Cross Product
We know that cross product operation is valid only for vectors in 3D
space, e.g. R3 . In the cases of finding cross product in 2D we
assume a planar problem in 3D space.
It can be understood intuitively if a pair of vectors lays in horizontal
plane in 3D space, then vertical coordinate of both vectors is equal to
zero, and direction of the resulting vector coincides with vertical axis.
ax bx x y z
ay × by = det ax ay 0 = x · 0 − y · 0 + z · det ax ay
bx by
az bz bx by 0
0 0
a ay
z · det x = 0 · (ax · by − bx · ay ) = 0
bx by
1 ax · by − bx · ay
Therefore, if we say ”cross product is equal to area of parallelogram”
13 of 24
in planar case in 2D, we mean a short form of 3D problem.
Cross Product
Example. 2
x x − 2x
There are two vectors on some basis a= , b= 2 .
1−x x − 2x + 1
It is needed to find x, when:
1. vectors are collinear;
2. they have the same direction.
Solution.
Two vectors are collinear if relations of their coordinates are equal, i.e.
xa ya za
= =
xb yb zb
Note: This condition is not valid if one of the components of the
vector is zero.
14 of 24
Cross Product
On the other hand, two vectors are collinear if their cross product is
equal to the null vector.
q.e.d.
15 of 24
Cross Product
Solution.
If the cross product of two vectors is zero then it can be said that they
are collinear.
Two vectors are in exactly the same direction if one is a positive scalar
multiple of the other.
0 0
For x1 = 0, a= and b= , then k = 1;
1 1
3 3
−
for x2 = 23 , a= 21 and b= 14 , then k = − 21 ;
−2
4
1 −1
for x3 = 1, a= and b= , then k = −1.
0 0
q.e.d.
16 of 24
Cross Product
Example.
Find the crossproduct
of:
3 2
1. vectors a=−2 and b=−5;
1 −3
3 −18
2. vectors a=−2 and b= 12 .
1 −6
Solution.
a2 · b3 − a3 · b2
a × b = a3 · b1 − a1 · b3
a1 · b2 − a2 · b1
17 of 24
Cross Product
−2 · (−3) − 1 · (−5)
a × b = 1 · 2 − 3 · (−3)
3 · (−5) − (−2) · 2
11
a × b = 11
−11
q.e.d.
Solution.
a×a=0
a × b = −6 · a × a ⇒ a × b = 0
q.e.d.
18 of 24
Cross Product
Example.
Simplify the expression: (a + b) × (a − b).
Solution.
a×a=0
a × b = −b × a
Then:
(a + b) × (a − b) = a × a − a × b + b × a − b × b
(a + b) × (a − b) = −2(a × b)
also
−2(a × b) = 2(b × a)
19 of 24
q.e.d.
Scalar Triple Product
Scalar triple product is a combination of dot product and cross product:
a · (b × c)
If we assume that vectors b and c form a base of parallepiped, and
vector a is the other edge of parallepiped then its volume is equal to
a · (b × c).
by bz c cz b by
= x · det + y · det x + z · det x
cy cz bx bz cx cy
On the other hand, in Cartesian coordinate system unit vectors are
orthogonal and normalized, then the result of cross product can be
represented as a vector:
bx cx by · cz − cy · bz
by × cy = cx · bz − bx · cz = g
bz cz bx · cy − cx · by
21 of 24
Scalar Triple Product
The height of parallepiped is equal to norm of projection of vector
a on vector g.
Therefore, h = ||a|| · cos (a, g) in some units.
Then the volume of parallepiped is V = S · h, V = ||g|| · ||a|| ·
cos (a, g). But this is also a dot product of vectors g and a.
ax gx ax by · cz − cy · bz
V = ay · gy = ay · cx · bz − bx · cz =
az gz az bx · cy − cx · by
= ax · (by · cz − cy · bz ) + ay · (cx · bz − bx · cz ) + az · (bx · cy − cx · by ) =
ax ay az
= det bx by bz
cx cy cz
q.e.d. 22 of 24
Scalar Triple Product
Important note!
Three vectors are coplanar if a · (b × c) = 0
or the same:
ax ay az
det bx by bz = 0
cx cy cz
23 of 24
References
24 of 24
View publication stats