### Lecture06_Dot_Cross_Products_NEW

```Dot & Cross Product
Dot Product (2.11)
• Symbolically:
•
– NOT, NOT, NOT vector multiplication
• Numeric Interpretation #1
•  =  ∗  + ⋯ +  ∗
– Result is a scalar.
•=•
– Example:
4
0
3 • 2 = 4 ∗ 0 + 3 ∗ 2 + −1 ∗ 5
5
−1
=0+6−5
=1
D.P. Application #1
• Look at  •
– Numerically: 1 ∗ 1 + ⋯ +  ∗
– Look familiar?
• Length, without the final square root.
• Or…the length squared
•=
Dot Product, cont.
• Numeric Interpretation #2:
•  =  ∗  ∗ cos(θ)
– Where θ is the angle made when the two vectors
are placed tail-to-tail.
– Comes from the Law of Cosines
Law of Cosines
C
γ
b
a
A
α
β
c
B
c 2  a 2  b2  2ab* cos( )
Sort of like the Pythagorean theorem for any triangle (not just right triangles)
Law of Cosines => D.P. Interp #2
1. Let  =  −
2. Let  =  −
3. Let  =  −
4. ● =  2 (by D.P App#1)

C
γ
b
a
A
– This equals b in the drawing above.
α
β
c

B
5. Similar steps for w and q
6.  2 = 2 + 2 − 2(γ) (Law of Cosines)
7. ( − )●( − ) = ● + ● − 2   cos γ
(using step 4)
8.  −  ●  −  = ● + ● − 2 ● (using
FOIL and distributive law of D.P., 2.13)
9. ● =   cos γ (substitue r.h.s of 8 into l.f.s
of 7 and simplify)
10.Q.E.D.
Let’s look at the 5two
interpretations



10
  
v 5
Let  0 
 

w   3
and  0 
Let’s draw a picture:
v
w
θ
w

θ is ≈ 60 degrees
Example, continued
10
  
v 5
 0 
5
  
w   3
 0 
Theta is ≈ 60.0 degrees.
Let’s hypothesize that interpretation#2 and interpretation#1 are both correct,
but let’s compare the numbers for this test case…just to be sure.
 
   
Interpretation#2:v  w  v * w * cos( )

v  102  52  02  100 25  125  11.18

w  52  (3) 2  02  25  9  31  5.57
   
v  w  v * w * cos   11.18 * 5.57 * cos(60)
Interpretation#1: v  w  10* 5  5 * (3)  0 * 0  50  15  35
 31.14
(Note: We guessed on theta, and rounded off the lengths. Otherwise
they would be identical)
Application of D.P #2
(Calculation of θ)
• We can come up with an exact value for θ, given any two vectors
using a little algebra and our two definitions of dot product.
   
v  w  v * w * cos( )
 
 
v * w * cos( )
v w
  
 
v *w
v *w
 
v w
   cos( )
v *w
 
v w
1
cos (   )  cos 1 (cos( ))
v *w
 
v w
1
  cos (   )
v *w
Application of Dot Product #3

θ is the angle between v and w. In each of these
cases, think of what cos(θ) would be…
w
cos(120)=-0.5
θ≈120
w
Acute
θ
θ
θ≈45
cos(45)=0.707
v
v
θ
v
θ≈120 cos(120)=-0.5
w
w
Obtuse
θ≈180 cos(180)=-1
θ
θ
v
θ≈90
cos(90)=0
w
NOTE: We never have to deal with
v
Right
.
Application of Dot Product #3
(θ “Categorization”)
• We can classify what type of angle is made by two vectors by looking at the
sign of the dot product.
• Acute:
• Obtuse:
• Right:
 
v  w  0
v  w
 0
vw 0
If v and w are both unit-length (normalized), we can make some more observations:

 1  vˆ  w  1 ALWAYS!
vˆ  wˆ  1 if they are equal (the d.p is close to 1 if they’re in the same general direction).
vˆ  wˆ  1 if they are opposite (the d.p is close to -1 if they’re in generally opposite directions).
Application #4 (projection)

Let v,w be two vectors.

Consider a triangle
w

θ
How long is a ?

A:  *cos(θ)
Remember: ● =

So…

a=
●

a
*cos(θ)


The projection of    is  (whose length is a)

=∗

Application #4, cont.
• For any two vectors,  and …
– The projection of  onto  is
– This can be simplified to:
•
●∗
2
•
●∗
●
●

∗

Application #4, cont.
• It works even if they make an obtuse angle

Cross Product (5.11)
 
• Symbolically: v  w
• Again, NOT, NOT, NOT vector multiplication!
• The result is a vector.
Cross Product (5.11)



A little trickier than dot product
Only useful (to us) in 3D
Imagine two vectors v,w




They aren't parallel (or antiparallel)
They lie in a plane
The plane has a normal. Call it n.
y
n
Define:
w
v× w= n

v
How do we compute it?

We can use a visualization
to remember...
z
x
Cross Product, Numerically
X=
Y=
Z=
x
y
z
Vx
Vy
Vz
Wx
Wy
Wz
x
y
z
Vx
Vy
Vz
Wx
Wy
Wz
x
y
z
Vx
Vy
Vz
Wx
Wy
Wz
v y * wz  vz * wy 
  

v  w   vz * wx  vx * wz 
vx * wy  v y * wx 


Another C.P. mnemonic
resultx  vy * wz  vz * wy
Increase the subscripts by 1, “wrapping” around from z=>x
resulty  vz * wx  vx * wz
Increase the subscripts by 1, “wrapping” around from z=>x
resultz  vx * wy  vy * wx
Memorize Me
Direction

Cross product is anticommutative


Meaning:
v x w = -(w x v)
Determining direction of result:

If we compute n = v x w: Use right-hand rule

Or, if in left handed space, use left-hand rule
w
n
v
Properties

Additional properties:



||v x w|| = area of parallelogram
||v x w|| = ||v|| ||w|| sin θ
v x v = (0,0,0) y
n
w
v
z
x
```