Lecture 2
2.1
Length
This is at the same time the length of the vector ~v = P1 P2 , denoted by ||~v||.
(x 2 ,y 2 ,z 2 )
z 2 -z 1
(x2 ,y2 )
d
(x 1 ,y1 )
y2 -y 1
(x 1,y1 ,z 1 )
y2 -y 1
x 2 -x 1
y
x 2 -x 1
x
x
Thus, the length of a vector ~v = hv1 , v2 , v3 i (or ~v = hv1 , v2 , v3 , . . . vn i), also called
the norm of ~v , is given by
q
||~v|| = v12 + v22 + v32
q
2
2
2
2
or ||~v|| = v1 + v2 + v3 + + vn .
= v1 h1, 0i + v2 h0, 1i
= v1~i + v2~j;
2.2
Dot Product
The dot product assigns a scalar (number) to two vectors. It can be defined in
any dimension.
Let ~u = hu1 , u2 i, ~v = hu1 , v2 i. Then the dot product of ~u and ~v is given by
~u ~v = u1 v1 + u2v2 .
Similarly, for ~u = hu1 , u2, u3 i, ~v = hv1 , v2 , v3 i,
~u ~v = u1 v1 + u2 v2 + u3 v3 ,
or, generally, for ~u = hu1 , u2 , . . . , un i, ~v = hv1 , v2 , . . . , vn i,
~u ~v = u1 v1 + u2 v2 + + un vn .
Notice that the length of a vector ~v can be expressed as
||~v|| = ~v ~v.
The relation between the dot product and the Euclidean geometric notion of
angle is the subject of the Theorem below.
Theorem 1 Let ~u, ~v be nonzero vectors in 2-space or 3-space3 , and let be the
angle between ~u and ~v . Then
~u ~v = ||~u||||~v|| cos ,
i.e.
cos =
~
u~
v
.
||~
u||||~
v||
Proof: We prove the case that ~u ~v are 2-space vectors. The 3-space case can be
proved similarly.
As in the diagram, we can use
~u and ~v to form the triangle
OP Q, where ~u = hu1 , u2i, ~v = hv1 , v2 i,
which is equivalent to
1
||~u||2 + ||~v||2 ||~v ~u||2
2
1 2
u1 + u22 + v12 + v22 (v1 u1 )2 + (v2 u2 )2
=
2
= u1 v1 + u2 v2
||~u||||~v|| cos =
= ~u ~v
i.e.
~u ~v = ||~u||||~v|| cos .
2
Theorem 1 shows that dot product can be used to calculate the angle between
two vectors. In particular, two non-zero vectors ~u, ~v are perpendicular if and only
if ~u ~v = 0, i.e. cos = 0.
Another consequence of Theorem 1 is the important Cauchy-Schwarz inequality
|~u ~v| ||~u||||~v||
3
u
~ ~
v
||~
u||||~
v||
with equality occuring only if the two vectors are parallel or one of them is the zero
vector.
Example 1. Let P1 = (1, 1, 1), P2 = (3, 0, 2) and P3 = (2, 2, 3). Find the angle
between P1 P2 and P1 P3 .
Solution: Let denote the angle. Then, by Theorem 1,
P1 P2 P1 P3
cos =
||P1 P2 ||||P1P3 ||
We have P1 P2
P1 P3
P1 P2 P1 P3
||P1P2 ||
||P1P3 ||
= h3 1, 0 1, 2 1i = h2, 1, 1i
= h2 1, 2 1, 3 1i = h1, 1, 2i
= 2 1 + (1) 1 + 1 2 = 3
p
=
22 + (1)2 + 12 = 6
=
1 2 + 12 + 22 = 6
Hence
1
3
cos = = , = 60o (or )
2
3
6 6
2
Dot product has the usual arithmetic properties which we list below, the proof
follows from the definition of dot product directly, and therefore will not be provided.
You are encouraged to prove some of them, at least (d).
If ~u, ~v, and w
~ are vectors and k is a scalar, then
(a) ~u ~v = ~v ~u
(b) ~u (~v + w)
~ = ~u ~v + ~u w
~
(c) k(~u ~v ) = (k~u) ~v = ~u (k~v)
(d) ~v ~v = ||~v||2 0 (and equality holds only for ~v = ~0).
Property (a) is called symmetry, (b) and (c) together bilinearity and (d) positivity. In a more abstract setting these properties are used to define dot products
in arbitrary vector spaces. This concept will be developed in Pmth213.
2.3
Orthogonal Projections
,
2
~u ~b
||~u|| ||~b||
(by Theorem 1)
~u ~b
.
||~b||
that is k =
~u ~b
.
||~b||2
proj~b ~u =
~u ~b ~
b
||~b||2
The above formula is also true if is greater than 90 . Please check this by
modifying the above proof.
Let us now look at some of the uses of this formula.
By definition, the distance between two sets P and Q in 2- or 3-space is the
infimum of all distances of a point P P and Q Q, i.e., roughly speaking, the
10
distance between the two points in P and Q that are closest to each other in the
respective sets:
dist(P, Q) = inf ||P Q||.
P P,QQ
Example 2. Find a formula for the distance D between the point P (x0 , y0 ) and
the line Ax + By + C = 0.
Solution: Let us use the graph at the
right to help with the argument. The distance from P to an arbitrary point Q on
the line is the hypotenuse of a right triangle with one leg being the distance from
P to the orthogonal projection (say Q )
and the other being the distance between
Q and Q . From ||P Q|| ||P Q|| we see
that the infimum of distances ||P Q|| is attained for Q = Q . Therefore we need to
find the orthogonal projection of P on the
line.
y
n
P
Q
x
ax+by+c=0
Let Q = (x1 , y1 ) be any point on the line (i.e. Ax1 + By1 + C = 0) and position
~n so that Q is its initial point. Then
QP ~n
D = || proj~n QP || = ||
~n|| (using Theorem 2)
||~n||2
QP ~n
=
||~n|| (using ||k~v|| = |k|||~v||)
||~n||2
|QP ~n|
=
||~n||
QP ~n = A(x0 x1 ) + B(y0 y1 )
= Ax0 + By0 Ax1 By1
A2 + B 2 and
||~n|| =
|Ax0 + By0 + C|
|QP
n|
=
D =
|| n ||
A2 + B 2
Note: The point Q is introduced just for an intermediate step, it does not appear
in the final formula.
11
Notice that the distance of a point P (x, y) to the y axis is just |x| and the distance
to the x-axis is just |y|. This can be verified by the formula with A = 0, B = 1, C = 0
and A = 1, B = 0, C = 0, respectively.
2.4
Cross Product
For vectors in 3-space only, another kind of product, called the cross product, is
defined. If ~uhu1, u2 , u3 i and ~v = hv1 , v2 , v3 i, then the cross product ~u ~v is a
vector given by
u2
~u ~v =
v2
~i
= u1
v1
u3
v3
~j
u2
v2
~i u1 u3 ~j + u1 u2 ~k
u1 v2
v1 v3
~k
u3
v3
~u (~v + w)
~
(~u + ~v ) w
~
k(~u ~v)
~u ~0
=
=
=
=
(~u ~v ) + (~u w)
~
(~u w)
~ + (~v w)
~
(k~u) ~v = ~u (k~v )
~0 ~u = ~0
12
(5) |~a (~b ~c)| is the volume of the parallelepiped spanned on the vectors ~a, ~b and
~c.
Hence
~b ~c =
=
~i ~j ~k
b1 b2 b3
c1 c2 c3
b2 b3 ~ b1 b3 ~ b1 b2 ~
k
i
j+
c2 c3
c1 c3
c1 c2
b1 b2
b1 b3
b2 b3
~
+ a3
a2
~a (b ~c) = a1
c1 c2
c1 c3
c2 c3
a1 a2 a3
= b1 b2 b3
c c c
1
2
3
u1 u2 u3
~u (~u ~v ) = u1 u2 u3 = 0,
v v v
1
2
3