Lecture#4
Lecture#4
Spring 2025
Instructor: Bo-Wen Shen, Ph.D.
Lecture #4:
Section 12.3: Inner Products
1
12.3 the Dot Product
(inner product; scalar product)
!
a = (a1, a2 , a3 )
!
b = (b1, b2 , b3 )
! !
a ⋅ b = a1b1 + a2 b2 + a3b3
4
12.3 the Dot Product
(inner product; scalar product)
𝑎⃗ = (2, 4)
𝑏 = (3, −1)
𝑎⃗ 0 𝑏 = 6 + (−4) = 2
𝑎⃗ 0 𝑏 = −6 + 14 + (−2) = 6 𝑎⃗ 0 𝑏 = 0 + 4 + 3 = 7
5
Scalar vs. Vector (Wikipedia)
7
Scalars and Vectors
8
Dot Product
! !
• Inner Product a = (a1, a2 , a3 ); b = (b1, b2 , b3 )
Ø Definition • Cross Product
! !
a ⋅ b = a1b1 + a2 b2 + a3b3
!
a = (a1, a2 , a3 ) ! ! !
! = +(...)i − (...) j + (...)k
b = (b1, b2 , b3 )
Ø Property (“Theorem”)
! !
a ⋅ b = a b cos(θ ) ! !
a × b = a b sin(θ )
• Projection è I.P.O.(d)
• Orthogonal when cos(𝜃) = 0
• Area è C.A.P.
• Parallel when sin(𝜃) = 0
10
12.3 the Dot Product: Definition and Theorem
2
a − b = ( b sin θ )2 + ( a − b cosθ )2
12
12.3 the Dot Product: Definition and Theorem
13
12.3 the Dot Product: Definition and Theorem
𝑎⃗ 0 𝑏 = 𝑎⃗ 𝑏 cos(𝜃)
𝜋
= 4 ∗ 6 ∗ cos( )
3
1
=4 ∗6∗
2
= 12
14
Properties of the Dot Product (Inner Product)
! !
a = (a1, a2 , a3 ) a = (a1, a2 , a3 )
! !
a = (a1, a2 , a3 ) b = (b1, b2 , b3 )
𝑎⃗ , 𝑎⃗ = 𝑎! 𝑎! + 𝑎" 𝑎" + 𝑎# 𝑎# ! 𝑎⃗ , 𝑏 = 𝑎!𝑏! + 𝑎"𝑏" + 𝑎#𝑏#
b = (b1, b2 , b3 )
= 𝑎!" + 𝑎"" + 𝑎#" ! 𝑎⃗ , 𝑏 = 𝑏 , 𝑎⃗
"
a = (a1, a2 , a3 )
𝑎⃗ , 𝑎⃗ = 𝑎⃗
𝑏 , 𝑎⃗ = 𝑏! 𝑎! + 𝑏" 𝑎" + 𝑏# 𝑎#
17
Properties of the Dot Product (Inner Product)
𝜃 = 90! → cos 𝜃 = 0
18
Examples
orthogonal
𝑎⃗ 0 𝑏 = 𝑎⃗ 𝑏 cos(𝜃) 𝑎⃗ 0 𝑏
cos(𝜃) =
𝑎⃗ 0 𝑏 𝑎⃗ 𝑏
cos(𝜃) =
𝑎⃗ 𝑏
10 − 6 − 2 2 𝑎⃗ 0 𝑏 = 10 − 8 − 2 = 0
= =
3 38 3 38 𝜋
2 𝜃=
𝜃 = cos "# 2
3 38
19
Basis Vectors and Basis Functions SUPP
(Wikipedia)
• The following vectors are called the standard basis vectors. They
have length 1 and point in the positive direction of x-, y- and z- axes.
20
Direction Angles and Direction Cosines
Ø Direction angles: the angles that a makes with the positive x-, y-, and
z-axes.
Ø A direction angle is the angle between a vector a and a basis vector.
Ø Direction cosines: the cosines of these direction angles.
𝑎⃗ = 𝑎# , 𝑎% , 𝑎$ 𝑏 = 𝚤⃗ 1, 0, 0 , 𝚥⃗ 0, 1, 0 , or 𝑘 0, 0, 1
𝑎⃗ 0 𝚤⃗ = 𝑎# 𝑎⃗ 0 𝚥⃗ = 𝑎% 𝑎⃗ 0 𝑘 = 𝑎$
21
Direction Angles and Direction Cosines
#
Ø cos 𝛼 =
#*
%
Ø cos 𝛽 =
#*
$
Ø cos 𝛾 =
#*
22
The Sign of the Inner Product
perpendicular 𝜃 = 90!
or orthogonal
24
12.3 the Dot Product
(inner product; scalar product)
!
a = (a1, a2 , a3 )
!
b = (b1, b2 , b3 )
! !
a ⋅ b = a1b1 + a2 b2 + a3b3
25
Dot Product
! !
• Inner Product a = (a1, a2 , a3 ); b = (b1, b2 , b3 )
Ø Definition • Cross Product
! !
a ⋅ b = a1b1 + a2 b2 + a3b3
!
a = (a1, a2 , a3 ) ! ! !
! = +(...)i − (...) j + (...)k
b = (b1, b2 , b3 )
Ø Property (“Theorem”)
! !
a ⋅ b = a b cos(θ ) ! !
a × b = a b sin(θ )
• Projection è I.P.O.(d)
• Orthogonal when cos(𝜃) = 0
• Area è C.A.P.
• Parallel when sin(𝜃) = 0
26
Projections in 3D Coordinate Systems
Point Q is called the projection of 𝑃(𝑎, 𝑏, 𝑐) onto the xy-plane (i.e., z=0)
Q è Replace the the 3rd coordinate by 0 è 𝑄(𝑎, 𝑏, 0) xy-plane
S è Replace the the 2nd coordinate by 0 è 𝑆(𝑎, 0, 𝑐) xz-plane
R è Replace the the 1st coordinate by 0 è 𝑅(0, 𝑏, 𝑐) yz-plane
𝑄𝑃 = 𝑂𝑃 − 𝑂𝑄 = 2𝑛𝑑 − 1𝑠𝑡
= (0,0, 𝑐)
𝑃(𝑎, 𝑏, 𝑐)
𝑄𝑃 0 𝚤⃗ = 0 90!
𝑄𝑃 0 𝚥⃗ = 0 90!
90
! 𝚤⃗
90 ! ←
𝚥⃗ → 𝑄(𝑎, 𝑏, 0)
27
Projection vs. Shadow
28
Review:
1 c
sin(θ ) csin(θ )
θ θ
cos(θ ) c cos(θ )
2 2 2 2 2 2 2
1 = cos (θ ) + sin (θ ) c = c cos (θ ) + c sin (θ )
Pythagorean Theorem Pythagorean Theorem
30
Projection vs. Shadow
35
Projection in terms of an Inner Product
TBD
𝑂𝑄 = c cos(𝜃) c
csin(θ )
𝑂𝑃 , 𝑂𝑄 = 𝑂𝑃 𝑂𝑄 cos(𝜃) θ
𝑂(0,0) c cos(θ ) 𝑄(𝑐 𝑐𝑜𝑠(𝜃), 0)
𝑂𝑃 𝑂𝑄 cos 𝜃 = c c cos 𝜃 cos(𝜃)
𝑂𝑃 0 𝑂𝑄 = (𝑐 𝑐𝑜𝑠(𝜃), 𝑐 sin(𝜃)) 0 𝑐 𝑐𝑜𝑠 𝜃 , 0 = 𝑐 % cos % (𝜃)
𝑂𝑃 0 𝑂𝑄 𝑂𝑃 0 𝑂𝑄
c cos 𝜃 = = projection of 𝑂𝑃 onto 𝑂𝑄
c cos 𝜃 𝑂𝑄
𝑂𝑄 𝑢 a unit vector;
c cos 𝜃 = 𝑂𝑃 0 = 𝑂𝑃 0 𝑢
𝑂𝑄 projection of 𝑂𝑃 onto 𝑂𝑄
36
Scalar Projection vs. Vector Projection
𝑎⃗ 0 𝑏 = 𝑎⃗ 𝑏 cos(𝜃)
+ -. 𝑎⃗
Ø Scalar projection of 𝑏 onto 𝑎: 𝑏 cos 𝜃 = =𝑏 0𝑢 𝑢=
+ 𝑎⃗
Ø Vector projection of 𝑏 onto 𝑎: indicating the direction
+ -. + -.
𝑏 cos 𝜃 𝑢 = 𝑢= 𝑎⃗
+ +!
𝑏 cos 𝜃 𝑏 cos 𝜃
38
Ex 6
+ -.
Ø Scalar projection of 𝑏 onto 𝑎: = 𝑏 0 𝑢 = 𝑏 cos 𝜃
+
Ø 𝑎⃗ 0 𝑏 = 𝑎⃗ 𝑏 cos 𝜃 𝑎⃗ = (−2, 3, 1)
+ -. 𝑏 = (1, 1, 2)
Ø 𝑏 cos 𝜃 =
+
$
Ø Scalar proj. 𝑏 cos 𝜃 = 𝑎⃗ 0 𝑏 = −2 + 3 + (2) = 3
#*
𝑎⃗ (−2, 3, 1)
𝑢= = 𝑎⃗ = −2 % + 3% + 1% = 14
𝑎⃗ 14
$ ("%,$,#) $ 3 $
Ø Vector proj. 𝑏 cos 𝜃 𝑢 = = (− , , )
#* #* 2 #* #*
41
Ex 7
𝐹⃗ = 70 𝐷 = 100 𝜃 = 35!
⃗ |𝐹|cos(𝜃)
Horizontal component of 𝐹: ⃗
=5734 𝑗 (Joule)
𝑎⃗ 0 𝑏 = 𝑎⃗ 𝑏 cos(𝜃) 𝑎⃗ 𝑏 cos 𝜃 = 𝑎⃗ 0 𝑏
Work = 𝐹⃗ cos 𝜃 𝐷 = 𝐹⃗ 0 𝐷
42
Ex 8
Work = 𝐹⃗ cos 𝜃 𝐷 = 𝐹⃗ 0 𝐷
𝐷 = 𝑃𝑄 = 𝑂𝑄 − 𝑂𝑃 (2nd – 1st )
𝐷 = (2, 5, 2)
𝐹⃗ = (3, 4, 5)
Work = 𝐹⃗ 0 𝐷 = 6 + 20 + 10 = 36
43
12.3 the Dot Product: Definition and Theorem
Pythagorean Theorem
2
a − b = ( b sin θ )2 + ( a − b cosθ )2
45
12.3 the Dot Product: Theorem
𝑃𝐴 = 𝑂𝐴 − 𝑂𝑃 = |𝑎| − 𝑏 cos(𝜃)
𝐵𝐴 = 𝑂𝐴 − 𝑂𝐵 = 𝑎⃗ − 𝑏
% % %
𝑎⃗ − 𝑏 = 𝑏 sin(𝜃) + |𝑎| − 𝑏 cos(𝜃)
% %
%
𝐿𝐻𝑆 = 𝑎⃗ − 𝑏 = 𝑎⃗ − 𝑏 0 𝑎⃗ − 𝑏 = 𝑎⃗ +𝑏 −2𝑎⃗ 0 𝑏
46
12.3 the Dot Product: Theorem
% % %
𝐿𝐻𝑆: 𝑎⃗ − 𝑏 = 𝑏 sin(𝜃) + |𝑎| − 𝑏 cos(𝜃) : 𝑅𝐻𝑆
% %
%
𝐿𝐻𝑆 = 𝑎⃗ − 𝑏 = 𝑎⃗ +𝑏 −2𝑎⃗ 0 𝑏
% %
% |%
𝑅𝐻𝑆 = 𝑏 sin (𝜃) + |𝑎 − 2 |𝑎| 𝑏 cos 𝜃 + 𝑏 cos % (𝜃)
%
= |𝑎 |% + 𝑏 − 2 |𝑎| 𝑏 cos 𝜃
• Use “a dot b” to represent 𝑎⃗ 0 𝑏
• Compare two boxes in green
and let LHS=RHS
−2𝑎⃗ 0 𝑏 = −2 |𝑎| 𝑏 cos 𝜃 • Remove common terms above
and report the remain terms
𝑎⃗ 0 𝑏 = |𝑎| 𝑏 cos 𝜃 • You have 1 minute
47
12.3 the Dot Product: Definition and Theorem
!
a = (a1, a2 , a3 )
!
b = (b1, b2 , b3 )
! !
a ⋅ b = a1b1 + a2 b2 + a3b3
48
Inner Product vs. Cross Product
! !
a = (a1, a2 , a3 ); b = (b1, b2 , b3 )
• Inner Product • Cross Product
! !
a ⋅ b = a1b1 + a2 b2 + a3b3
!
a = (a1, a2 , a3 ) ! ! !
! = +(...)i − (...) j + (...)k
b = (b1, b2 , b3 )
! ! ! !
a ⋅ b = a b cos(θ ) a × b = a b sin(θ )
• Projection è I.P.O.(d) • Area è C.A.P.
• Orthogonal when cos(𝜃) = 0 • Parallel when sin(𝜃) = 0
50
Inner Product vs. Cross Product
! ! ! !
a ⋅ b = a b cos(θ ) a × b = a b sin(θ )
• I.P.O.(d) • C.A.P.
• Orthogonal when cos(𝜃) = 0 • Parallel when sin(𝜃) = 0
51
Neural Network: A Simple Perceptron
input output
𝑊 = (𝑊# , 𝑊% , 𝑊$ ):
𝑌#
𝑂𝑃 = (𝑋, 𝑌, 𝑍) weights, “coefficients”
𝑊#
𝑊%
𝑊$
𝑌# = 𝑂𝑃 ⋅ 𝑊 = 𝑋, 𝑌, 𝑍 ⋅ 𝑊# , 𝑊% , 𝑊$
= 𝑊# 𝑋 + 𝑊% 𝑌 + 𝑊$ 𝑍 weighted sum
52