4.4: Length of a Vector
( \newcommand{\kernel}{\mathrm{null}\,}\)
- Find the length of a vector and the distance between two points in Rn.
- Find the corresponding unit vector to a vector in Rn.
In this section, we explore what is meant by the length of a vector in Rn. We develop this concept by first looking at the distance between two points in Rn.
First, we will consider the concept of distance for R, that is, for points in R1. Here, the distance between two points P and Q is given by the absolute value of their difference. We denote the distance between P and Q by d(P,Q) which is defined as d(P,Q)=√(P−Q)2
Consider now the case for n=2, demonstrated by the following picture.

There are two points P=(p1,p2) and Q=(q1,q2) in the plane. The distance between these points is shown in the picture as a solid line. Notice that this line is the hypotenuse of a right triangle which is half of the rectangle shown in dotted lines. We want to find the length of this hypotenuse which will give the distance between the two points. Note the lengths of the sides of this triangle are |p1−q1| and |p2−q2|, the absolute value of the difference in these values. Therefore, the Pythagorean Theorem implies the length of the hypotenuse (and thus the distance between P and Q) equals (|p1−q1|2+|p2−q2|2)1/2=((p1−q1)2+(p2−q2)2)1/2
Now suppose n=3 and let P=(p1,p2,p3) and Q=(q1,q2,q3) be two points in R3. Consider the following picture in which the solid line joins the two points and a dotted line joins the points (q1,q2,q3) and (p1,p2,q3).

Here, we need to use Pythagorean Theorem twice in order to find the length of the solid line. First, by the Pythagorean Theorem, the length of the dotted line joining (q1,q2,q3) and (p1,p2,q3) equals ((p1−q1)2+(p2−q2)2)1/2 while the length of the line joining (p1,p2,q3) to (p1,p2,p3) is just |p3−q3|. Therefore, by the Pythagorean Theorem again, the length of the line joining the points P=(p1,p2,p3) and Q=(q1,q2,q3) equals ((((p1−q1)2+(p2−q2)2)1/2)2+(p3−q3)2)1/2 =((p1−q1)2+(p2−q2)2+(p3−q3)2)1/2
This discussion motivates the following definition for the distance between points in Rn.
Let P=(p1,⋯,pn) and Q=(q1,⋯,qn) be two points in Rn. Then the distance between these points is defined as distance between P and Q =d(P,Q)=(n∑k=1|pk−qk|2)1/2 This is called the distance formula. We may also write |P−Q| as the distance between P and Q.
From the above discussion, you can see that Definition 4.4.1 holds for the special cases n=1,2,3, as in Equations (???), (???), (???). In the following example, we use Definition 4.4.1 to find the distance between two points in R4.
Find the distance between the points P and Q in R4, where P and Q are given by P=(1,2,−4,6) and Q=(2,3,−1,0)
Solution
We will use the formula given in Definition 4.4.1 to find the distance between P and Q. Use the distance formula and write d(P,Q)=((1−2)2+(2−3)2+(−4−(−1))2+(6−0)2)12=47
Therefore, d(P,Q)=√47.
There are certain properties of the distance between points which are important in our study. These are outlined in the following theorem.
Let P and Q be points in Rn, and let the distance between them, d(P,Q), be given as in Definition 4.4.1. Then, the following properties hold.
- d(P,Q)=d(Q,P)
- d(P,Q)≥0, and equals 0 exactly when P=Q.
There are many applications of the concept of distance. For instance, given two points, we can ask what collection of points are all the same distance between the given points. This is explored in the following example.
Describe the points in R3 which are at the same distance between (1,2,3) and (0,1,2).
Solution
Let P=(p1,p2,p3) be such a point. Therefore, P is the same distance from (1,2,3) and (0,1,2). Then byDefinition 4.4.1, √(p1−1)2+(p2−2)2+(p3−3)2=√(p1−0)2+(p2−1)2+(p3−2)2 Squaring both sides we obtain (p1−1)2+(p2−2)2+(p3−3)2=p21+(p2−1)2+(p3−2)2 and so p21−2p1+14+p22−4p2+p23−6p3=p21+p22−2p2+5+p23−4p3 Simplifying, this becomes −2p1+14−4p2−6p3=−2p2+5−4p3 which can be written as 2p1+2p2+2p3=−9 Therefore, the points P=(p1,p2,p3) which are the same distance from each of the given points form a plane whose equation is given by (???).
We can now use our understanding of the distance between two points to define what is meant by the length of a vector. Consider the following definition.
Let →u=[u1⋯un]T be a vector in Rn. Then, the length of →u, written ‖→u‖ is given by ‖→u‖=√u21+⋯+u2n
This definition corresponds to Definition 4.4.1, if you consider the vector →u to have its tail at the point 0=(0,⋯,0) and its tip at the point U=(u1,⋯,un). Then the length of →u is equal to the distance between 0 and U, d(0,U). In general, d(P,Q)=||→PQ||.
ConsiderExample 4.4.1. ByDefinition 4.4.2, we could also find the distance between P and Q as the length of the vector connecting them. Hence, if we were to draw a vector →PQ with its tail at P and its point at Q, this vector would have length equal to √47.
We conclude this section with a new definition for the special case of vectors of length 1.
Let →u be a vector in Rn. Then, we call →u a unit vector if it has length 1, that is if ‖→u‖=1
Let →v be a vector in Rn. Then, the vector →u which has the same direction as →v but length equal to 1 is the corresponding unit vector of →v. This vector is given by →u=1‖→v‖→v
We often use the term normalize to refer to this process. When we normalize a vector, we find the corresponding unit vector of length 1. Consider the following example.
Let →v be given by →v=[1−34]T Find the unit vector →u which has the same direction as →v.
Solution
We will use Definition 4.4.3 to solve this. Therefore, we need to find the length of →v which, by Definition 4.4.2 is given by ‖→v‖=√v21+v22+v23 Using the corresponding values we find that ‖→v‖=√12+(−3)2+42=√1+9+16=√26 In order to find →u, we divide →v by √26. The result is →u=1‖→v‖→v=1√26[1−34]T=[1√26−3√264√26]T
You can verify using the Definition 4.4.1 that ‖→u‖=1.