Section 1.2
The Norm and the Dot Product
Introduction
We will study geometric entities such as: angle between two vectors, distance, norm of a vector,
orthogonality and other related notions.
Magnitude (length or norm) of a Vector
Example 1.1 Let u a vector in .
>
> u:=vector([4,1]);
Plot the vector.
>
> plotnorm(u);
Length is given as .
******************************************************************
Let v = [ , , . . ., ] be a vector in the Euclidean space . The norm or
magnitude of v is || v || = .
******************************************************************
Compute the norm of the vector u.
> u := vector([-2,1,3,-1]);
>
> `||u||` = norm(u,2);
******************************************************************
Theorem 1.2 Properties of the Norm in .
For all vectors v and w in and for all scalars r , we have
1.) || v || > 0 for all nonzero vectors v and || v | |= 0 if and only if v = 0
2.) || r v || = |r| || v ||
3.) || v + w || <= || v || + || w || (Triangle Inequality)
******************************************************************
Unit vectors
A unit vector is any vector that has magnitude (or norm) 1.
> u := vector([1,2]);
>
> plotvectorscalar(1/norm(u,2),u);
Dot (Inner) Product
Let u and v be two vectors in .
> u:=vector([4,1,7]); v:=vector([1,3,5]);
>
>
Consider the sum of the product of the components of the two vectors
>
>
u[1]*v[1] + u[2]*v[2] + u[3]*v[3];
This product yields a number not a vector!
> `(u,v)` = dotprod(u,v);
******************************************************************
The standard inner product or dot product of any two vectors u and v in the Euclidean
space is a scalar that is equal to the sum of the product of the corresponding components
of the given vectors. Thus, if u := [ ,...., ] and v : = [ ,...., ], then the
inner product of u and v denoted by innerprod( u,v ) is
> `(u,v)`=Sum(ai*bi,i=1..n);
>
******************************************************************
Example: Let v be a vector in .
>
> v:=vector([x,y]);
What if we take the inner product of v with itself?
>
> dotprod(v,v);
This number is always positive. The square root of this number represents the
distance from the origin to the point [x,y] in the length of the vector v .
>
> L:=sqrt(x^2+y^2);
Consider a vector in .
> v:=vector([x,y,z]);
and the inner product of v with itself is
> dotprod(v,v);
Again this number is always positive. The square root of this number represents the
distance from the origin to the point [x,y,z] in or the length of the vector v .
> L:=sqrt(x^2+y^2+z^2);
>
> u:=vector([4,1,7]);
> norm(u,2);
> sqrt(dotprod(u,u));
>
********************************************************************
(P1) the dot (inner) product of two vectors is commutative.That is,
for all vector u and v
(P2) the dot (inner) product of a vector with itself is always positive unless the
vector is a zero vector. That is,
if and only if u is the zero vector
(P3) the dot (inner) product is bilinear in the sense that the inner product of
and w is equal to the sum of the inner products of
with w and with w .That is,
[ , w ] =
where we denote here dotprod(v,u) by or or .
*********************************************************************
Angle between two vectors
>
Let us recall from trigonometry the cosine law:
> c^2=a^2+b^2-2*a*b*cos(theta);
where a, b, and c are the lengths of the sides AB, AC and BC of the triangle ABC respectively.
> plottriangle();
Example: Consider the two vectors.
> u := vector([1,2]); v := vector([3,-1]);
Construct the sides of the triangle ABC.
> plottriangle2();
Compute the lengths of the three vectors.
>
a :=sqrt(dotprod(u,u));
b :=sqrt(dotprod(v,v));
c :=sqrt(dotprod(u-v,u-v));
The cosine law implies that
> cos(theta)=(a^2+b^2-c^2)/(2*a*b);
>
Compute the ratio
> dotprod(u, v)/(a*b);
>
*******************************************************************
= dotprod( u,v ) = || v| | * || u || * cos( )
where is the angle between the two vectors u and v and || . || represents the
length of the vector.
*********************************************************************
*********************************************************************
From the geometric definition of the dot (inner) product, we make two inferences
(i) Two nonzero vectors u and v are orthogonal (or prependicular) if and only if
dotprod(u,v) = 0. i.e. the angle between the vectors is or .
(ii) we may conclude the Cauchy-Schwartz inequality
| | = |dotprod(u,v)| <= || u || * || v || and the equality
holds when one vector is a scalar multiple of the other.
*******************************************************************
Find the dot product and the angle between the two vectors
> v := vector([1,2,0,2]);
> u := vector([-3,1,1,5]);
> dotprod(u,v);
> `Angle between u and v` = dotprod(u,v)/(norm(u,2)*norm(v,2));
Are the following two vectors perpendicular?
> v := vector([4,1,-2,1]);
> u := vector([3,-4,2,-4]);
Application
Closest Point to a vector
Example: Draw the vector v from (0,0) to the point (3,1). Find a point on v that is
closest to the point (1,2 )?
Let (x,y) be any point on vector v. Since point (x,y) is on vector v, the point must satisfy .
Vector v and point (x,y) are then given by
> v:=vector([3,1]);P:=vector([3*y,y]);
To find the point P closest to the point (1,2), construct the vector
> w:=vector([3*y-1,y-2]);
such that it is orthogonal to vector P; that is,
> dotprod(w,P)=0;
The required point is
> P:=[3/2,1/2];
>
Exercises
1-13(odd), 25, 27, 33, 36, 40.