You are on page 1of 16

CHAPTER 3

Distances and Angles

1. Scalar Product
In this chapter we extend our vector geometry toolbox to be able to treat con-
cepts like length, angles, distance and orthogonality in the three dimensional space.
To this end we introduce a powerful tool in linear algebra, namely the scalar product,
also called dot product or inner product. This is basically a rule that associates a
number (scalar) to each pair of vectors in a very clever way.

We start by assuming a fixed length scale in the three dimensional space such that
each vector u has a determined length, denoted kuk. Angles between vectors are
given in radians and by the angle between two vectors u and v we mean the angle
between 0 and π radians formed by u and v when set to emerge from a common
point.

We are now properly equipped to state the following definition:


Definition 1. Let u, v be two vectors in space and let θ be the angle between
them (in the interval 0 ≤ θ ≤ π). Their scalar product is the number (u|v) defined
by
(u|v) = kuk · kvk · cos θ.
If u = 0 or v = 0, the angle θ is not defined, but in these cases we define (u|v) = 0.

The word “scalar” is a synonym for “number”; the term “scalar product” is used
because the result (u|v) is a real number and not a vector.
39
40 3. DISTANCES AND ANGLES

Now consider the case when v = e is a unit vector, i.e., kek = 1. If θ is the angle
between u and e, then
(1) (u|e) = kuk cos θ.

We shall find an important geometric interpretation of this formula: Place u and


e so that they emanate from the same point and let ` be a line through this point,
with direction vector e. The orthogonal projection of u of ` (See Chapter 2, end of
Section 2) can be written as
(2) u00 = (kuk cos θ)e.
(This can be verified by an elementary trigonometrical argument – we ask the reader
to work out the details.)

Comparing the formulae (1) and (2), we can write


u00 = (u|e) · e,
and thus the number (u|e) is the coordinate of the orthogonal projection u00 in the
basis e for `.

If v 6= 0 is not a unit vector, we write


(u|v) = kvk · (u|e),
1
where e = · v is a unit vector. Thus, the absolute value |(u|v)| is equal to
kvk
the length of v times the length of the orthogonal projection of u on a line with
direction vector v.

Note that the sign of (u|v) is positive if the angle between u and v is acute, and
negative if it is obtuse.
1. SCALAR PRODUCT 41

Properties of the scalar product.

The scalar product satisfies the following rules. ( u, v, w denote arbitrary vectors.)
(I) (u|v) = (v|u)
(II) (u + v|w) = (u|w) + (v|w)
(III) (tu|v) = t (u|v) , t ∈ R
(IV) (u|u) ≥p0 with (u|u) = 0 if and only if u = 0
(V) kuk = (u|u)

The rule (I) is called symmetry of the scalar product; (II) and (III) together are
called linearity in the first argument; (IV) is called positive definiteness.

The properties (I),(III), (IV) and (V) are immediate; (II) can be seen in the follow-
ing way: If w = e is a unit vector, then, by the geometrical interpretation of the
scalar product, we can see that (II) means precisely that
(u + v)00 = u00 + v00 .
That this is the case was shown at the end of Chap. 2, Sect. 2. This proves that
(II) holds when w is a unit vector. For general w, we now get (II) by applying the
unit vector case to the vector e in the formula (u|w) = kwk · (u|e).

Remark 2. Note that linearity in the second argument follows from the sym-
metry and the linearity in the first argument. In particular, we have (u|tv) = t(u|v).

As an application of the scalar product, we prove a well-known theorem. We say


that two vectors u, v are orthogonal to each other if (u|v) = 0. (This means that
the angle θ = π/2, or that one of u or v is the zero vector.)
Theorem 3. (Pythagoras’ Theorem) If u and v are orthogonal, then
ku + vk2 = kuk2 + kvk2 .
42 3. DISTANCES AND ANGLES

Proof. If u, v are any vectors (orthogonal or not), then by the computational


rules above
ku + vk2 = (u + v|u + v)
= (u|u) + (u|v) + (v|u) + (v|v)
= kuk2 + 2(u|v) + kvk2 .
Hence if (u|v) = 0, then
ku + vk2 = kuk2 + kvk2 .

The scalar product can often be used to give easier proofs to well-known theorems
from Euclidean geometry that involve orthogonality, angles and distance relation-
ships. The following statement is one such example.

Example 1. An angle inscribed in a semicircle is a right angle.

In order to prove this let us introduce some notations. Let C be a circle with centre
M and radius r, and P , Q and R be three different points on the circle such that
−→
P R is a diameter.

We prove that the inscribed angle ∠P QR is a right angle by showing that the scalar
−→ −→
product (QP |QR) is equal to zero.
−→ −−→ −−→ −→ −−→ −−→
We have that QP = QM + M P and QR = QM + M R which gives
−→ −→ −−→ −−→ −−→ −−→ 
(3) (QP |QR) = (QM + M P )|(QM + M R) =
−−→ −−→ −−→ −−→ −−→ −−→ −−→ −−→
=(QM |QM ) + (QM |M R) + (M P |QM ) + (M P |M R).
−→ −→
Since kP Rk = 2r and the centre M is the midpoint of the segment P R we have
−−→ −−→ −−→ −−→
that P M = M R and hence, M P = −M R. This yields
−−→ −−→ −−→ −−→ −−→ −−→ −−→ −−→ −−→ −−→
(M P |QM ) = (−M R|QM ) = −(QM |M R) and (M P |M R) = −(M R|M R).
1. SCALAR PRODUCT 43

The equality (3) can also be written as:


−→ −→ −−→ −−→ −−→ −−→ −−→ −−→ −−→ −−→
(QP |QR) =(QM |QM ) + (QM |M R) − (QM |M R) − (M R|M R)
−−→ −−→
=kQM k2 − kM Rk2 = r2 − r2 = 0
which concludes the proof.
Exercises.
1. Let θ be the angle between the sides AB and BC in a triangle ABC. Prove
the law of cosines:
−→ 2 −→ 2 −−→ 2 −→ −−→
AC = AB + BC − 2 AB BC cos θ.


(Observe that this reduces to Pythagoras’ Theorem when θ = π/2.)

2. Let u and v be two non-zero vectors such that ku + vk = ku − vk. Show


that the angle θ between the two vectors u and v is right.

3. Let u and v be two non-zero vectors such that u + 3v is orthogonal to


2u − v and u + 7v is orthogonal to 2u + v. Determine the angle θ between
the vectors u and v.

4. Denote by a and b the side-lengths in a parallelogram, and by c and d the


lengths of the diagonals. Prove the parallelogram law :
c 2 + d 2 = 2 a2 + b 2 .

44 3. DISTANCES AND ANGLES

2. Scalar Product and Orthonormal Bases

Orthonormal basis for a plane.


Let M be a plane and e1 , e2 a basis for M . If
u = x 1 e 1 + x2 e 2 and v = y1 e1 + y2 e2
are two vectors in M , then by the rules (I)–(III) for the scalar product,
(u|v) = x1 y1 (e1 |e1 ) + (x1 y2 + x2 y1 )(e1 |e2 ) + x2 y2 (e2 |e2 ).
If the basis vectors e1 , e2 are orthogonal and have length 1, then the expression (u|v)
becomes particularly simple. In this case (e1 |e1 ) = (e2 |e2 ) = 1 and (e1 |e2 ) = 0,
and thus
(4) (u|v) = x1 y1 + x2 y2 .

A basis for a plane consisting of two orthogonal unit vectors is called an orthonormal
basis (in short: ON-basis) for the plane.

Orthonormal basis for the three dimensional space.


The corresponding definition in three dimensions is the following. We say that three
vectors e1 , e2 , e3 are pairwise orthogonal if
(ej |ek ) = 0, when j 6= k.
Three vectors e1 , e2 , e3 are said to form an orthonormal basis for three-dimensional
space if (i) they have unit length, and (ii) they are pairwise orthogonal. We can
sumarise the definition of orthonormal basis by the equation
(
0 if j 6= k
(ej |ek ) = .
1 if j = k
If e1 , e2 , e3 form an orthonormal basis and
u = x1 e1 + x2 e2 + x3 e3 and v = y1 e1 + y2 e2 + y3 e3 ,
2. SCALAR PRODUCT AND ORTHONORMAL BASES 45

then
(5) (u|v) = x1 y1 + x2 y2 + x3 y3 .
When u = v this reduces to
(6) kuk2 = x21 + x22 + x23 .
This can be regarded as the three-dimensional version of the theorem of Pythagoras.

(u is here the sum of three pairwise orthogonal vectors x1 e1 , x2 e2 , x3 e3 .)


Example 1. Suppose that u and v have coordinates
u = (4, 1, 1) and v = (2, 2, −1)
with respect to some orthonormal basis. We shall determine the angle θ between u
and v. For this purpose we use (5) and (6) to compute
(u|v) = 4 · 2 + 1 · 2 + 1 · (−1) = 9
√ √
kuk = 16 + 1 + 1 = 3 2

kvk = 4 + 4 + 1 = 3.
Since (u|v) = kukkvk cos θ, this gives
(u|v) 9 1
cos θ = = √ =√ .
kukvk 3 2·3 2
This means that θ = π/4.
Example 2. The formula (4) can be used to prove many trigonometrical identities.
(As we know, the de Moivre formula for multiplication of complex numbers provides
another way to do this.)

As an example, we shall now show the following version of the addition formula for
cosines:
(7) cos(α − β) = cos α cos β + sin α sin β.
46 3. DISTANCES AND ANGLES

To this end, let e1 , e2 be an orthonormal basis for the plane and put
u = (cos α)e1 + (sin α)e2 , v = (cos β)e1 + (sin β)e2 .
Since u and v then have length 1, while the angle between them is |α − β|, the
definition of scalar product shows that
(u|v) = cos(α − β).
(We have here used the fact that cos is even: cos(α − β) = cos(β − α).)

On the other hand, by (4), we have


(u|v) = cos α cos β + sin α sin β.
Comparing the two expressions for (u|v), we infer that the formula (7) holds. 
Exercises.
5. A triangle in space has vertices at the points (1, 0, 2), (0, −1, 1), and (2, 1, 2)
according to some orthonormal basis. Compute all side-lengths and cosines
of angles in the triangle.

6. Consider the vectors v1 = (1, 3, a), v2 = (1, 1, −a) and v3 = (b, −a, 1) with
respect to some orthonormal basis. Determine all real numbers a, b such
that the vectors are mutually orthogonal.

7. Let e1 , e2 , e3 be an orthonormal basis in space. Suppose that the vector u


makes the angle π/4 to the vector e1 and the angle π/3 to the vector e2 .
What are the possible angles between u and e3 ?
3. COMPUTING DISTANCES AND ANGLES 47

3. Computing Distances and Angles


A coordinate system Oe1 e2 e3 where e1 , e2 , e3 is an orthonormal basis is called
an orthonormal system or an ON-system. In this section we fix an ON-system and
assume that all points are represented in that system.

The distance between two points P = (x, y, z) and Q = (x0 , y0 , z0 ) is then given by
−→ p
P Q = (x − x0 )2 + (y − y0 )2 + (z − z0 )2 .

Distance between a point and a line


Consider a line ` and a point P which is not on the line. By the distance between
P and ` we mean the shortest possible distance between P to a point R ∈ `.
A geometric consideration shows that the closest point R is determined by the
−→
condition that P R is orthogonal to the direction vector of `.

Example 1. Let ` be the line through the points Q = (−2, 1, 1) and S = (0, −1, 2),
and let P = (1, 2, 1). We shall compute the distance from P to `.
−→
First note that ` has direction vector QS = (2, −2, 1), so it has the parametric
representation 
x = −2 + 2t

` : y = 1 − 2t .

z = 1+ t

48 3. DISTANCES AND ANGLES

We now seek the closest point R ∈ ` to P . To this end let R = (−2+2t, 1−2t, 1+t)
−→
and we must determine t so that P R is orthogonal to the direction vector (2, −2, 1)
of `. That is, we shall have
−→ −→
0 = P R|QS = (−3 + 2t) · 2 + (−1 − 2t) · (−2) + t · 1 = 9t − 4.
−→
This gives t = 4/9 and P R = 91 (−19, −17, 4). The distance from P to ` is thus
−→ 1 √ √
74
P R = 192 + 172 + 42 = .

9 3

Distance from a point to a plane


Let π be a plane in space, Q a point in π, and n a unit normal vector to π.
(This means that n has unit length and points in a direction orthogonal to π.)
The distance d between a point P and π is again defined as the smallest distance

between P to some point in π. We assert that


 −→
(8) d = n|QP .

−→
To prove this, itsuffices to note that the orthogonal projection of the vector QP
−→
on n is equal to n|QP · n. The length of the latter vector must thus equal to the
sought distance, which proves (8).
Now suppose that Q = (x0 , xy , z0 ), P = (x, y, z), and n = (A, B, C). Then
 −→
n|QP = A(x − x0 ) + B(y − y0 ) + C(z − z0 ).
If we put
D = Ax0 + By0 + Cz0 ,
then (8) can be written
(9) d = |Ax + By + Cz − D| .
3. COMPUTING DISTANCES AND ANGLES 49

But P belongs to π precisely when d = 0, i.e., when


(10) Ax + By + Cz = D.
We have shown that an arbitrary plane can be described by a linear equation of
the type (10). If P = (x, y, z) is not in π, then its distance to π is given by (9).
Remark 4. The argument above shows that if we have a plane of the form
(10), then n = (A, B, C) is a normal vector. Above we assumed that n is a unit
vector, i.e., that
A2 + B 2 + C 2 = 1.
If
√ this is not satisfied, one must first normalise the equation (10) by dividing with
A2 + B 2 + C 2 . The distance formula then becomes
|Ax + By + Cz − D|
(11) d= √ .
A2 + B 2 + C 2
Example 2. We shall determine an equation for the plane π which passes through
the point (1, −1, 2) and has the normal

x = 1 + 3t

` : y = 3 + 2t .

z = 2− t

The direction vector of `, i.e. the vector (3, 2, −1) must then be a normal vector of
π. Since the point (1, −1, 2) belongs to π, the equation of the plane becomes
3(x − 1) + 2(y − (−1)) + (−1)(z − 2) = 0,
i.e.,
3x + 2y − z = −1.
The distance from the point P = (5, 6, 7) to π is thus (see (11))
|3 · 5 + 2 · 6 − 1 · 7 + 1| 21
√ =√ .
2
3 +2 +12 2 14
50 3. DISTANCES AND ANGLES

Distance between two lines


Given two lines which do not intersect, we define the distance between them to be
the smallest possible distance between one point on the first line and one on the
second one. The following example comprises a method to compute such a distance.

Example 3. Consider the lines `1 and `2 having parametric representations


 
x = −3 + 2t
 x = 3 + t

`1 : y = t ; `2 : y = 4 + 3t .
 
z = 1− t z = 2 + 2t
 

We shall compute the (shortest) distance between `1 and `2 . Direction vectors


for the two lines are (2, 1, −1) and (1, 3, 2). Let π be the plane parallel to these
directions, which passes through the point (−3, 0, 1) on `1 . Then `1 ⊂ π and also, π
is parallel to `2 . Hence the distance d between `1 and `2 must equal to the distance
from an arbitrary point on `2 to π. A parametric representation of π is

x = −3 + 2t + s

π: y= t + 3s .

z = 1 − t + 2s

Elimination of s and t gives the equation

x − y + z = −2

for the plane π. The distance from the point (3, 4, 2) on `2 to π is, according to
(11)
|3 − 4 + 2 + 2| 3 √
d= √ = √ = 3.
1+1+1 3

The distance between the lines is thus 3.

Angle between two planes


If π1 , π2 are two planes, we define the angle between them to be the angle between
the corresponding normal vectors. (In general there are two possibilities for the
angle, depending on the mutual orientations of the normal vectors: see the example
below.)

Example 4. Suppose that

π1 : x − 2y − 2z = −3 π2 : x + 4y + z = 5.
3. COMPUTING DISTANCES AND ANGLES 51

Corresponding normal vectors are n1 = (1, −2, −2) and n2 = (1, 4, 1). The angle θ
between the planes then satisfies
(n1 |n2 ) 1 · 1 + (−2) · 4 + (−2) · 1 1
cos θ = =√ √ = −√ .
kn1 kkn2 k 12 + 22 + 22 · 12 + 42 + 12 2
This gives θ = 3π/4. This is the obtuse angle between the planes. There is also
another possibility, namely if we substitute −n1 for n1 above. This leads to the
acute angle π − θ = π/4.

Angle between a line and a plane


To determine the angle between a line ` and a plane π, one first computes the acute
angle ψ between ` and a normal vector to π. The angle ϕ between ` and π is defined
by ϕ + ψ = π/2.

Example 5. Suppose that



x = 2 + t

`: y =3+ t ; π : 4x − 11y − 5z = −2.

z = 1 + 4t

Let θ denote the angle between the direction vector (1, 1, 4) of ` and the normal
vector (4, −11, −5) of π. Then
1 · 4 + 1 · (−11) + 4 · (−5) 1
cos θ = √ √ =− .
12 + 12 + 42 · 42 + 112 + 52 2
This gives θ = 2π/3, which is obtuse. Hence the acute angle between ` and the
normal to π is ψ = π − θ = π/3. The angle between ` and π is thus
ϕ = π/2 − ψ = π/6.
52 3. DISTANCES AND ANGLES

Exercises.
8. Compute the distance between the point (1, 2, 3) and the line

x = 1 − t

y = −4 + 2t .

z = 3− t

9. The line ` is the intersection between the planes x + 2y − 2z = 5 and


2x − y + z = 0. Determine the point on ` which is closest to the origin.

10. The line ` passes through the point (1, 2, 3) and is perpendicular to the
plane 2x − 3y + z = −3. Find the distance between ` and the point (4, 5, 6).

11. Determine, in the form Ax + By + Cz = D, the equation of the plane which


consists of all points which have equal distance to the points (1, 2, 0) and
(−1, 0, 2).

12. Find the distance from the plane 3x − 4y + 12z = 13 to the points (0, 0, 0)
and (2, 1, 3). Are these points on the same or on opposite sides of the plane?

13. a) Determine, in the form Ax + By + Cz = D, an equation for the plane


M which passes through the points (2, −3, 0) and (2, −2, 2), and is parallel
to the line x = 2 − t, y = 1 + t, z = 2 − t.
b) Find the distance between the point (3, −1, 0) and M .

14. Find the point closest to the point (−2, −2, −1) in the plane passing through
the points (1, 3, −1), (1, 1, 0), (−1, 3, 2).

15. a) Prove that the lines


 
x = 1 + t
 x = 3 + t

`1 : y =2− t and `2 : y =2+ t
 
z = 3 + 2t z = 2 − 3t
 

intersect at a point.
b) Find the distance between the point (3, 4, 5) and the plane spanned by
`1 and `2 .
4. ANSWERS TO EXERCISES 53

16. A ray of light is emitted from the point (3, −2, −1) and reflected off the
plane x − 2y − 2z = 0. The reflected ray passes the point (4, −1, −6). At
which point does the ray hit the plane?

17. Determine the distance between the lines


a) (x, y, z) = t(−3, 3, 1) and (x, y, z) = (−1, 0, 0) + t(1, 1, 1).
b) (x, y, z) = (1, 2, 3) + t(0, 1, 1) and (x, y, z) = (1, 1, 1) + t(2, 3, 1).

18. Consider the lines


 
x = 8 − 3t
 x = −12 − t

`1 : y = 2− t and `2 : y= 4 − 2t .
 
z = −3 + t z= 1+ t
 

Determine, in the form Ax + By + Cz = D, an equation for the plane which


is parallel to `1 and `2 and has the same distance to the two lines.

19. a) Determine, in the form Ax + By + Cz = D, an equation for the plane


M which passes through the points (2, −1, 3), (1, 2, −2), and (1, 0, 2).
b) Determine the angle between M and the plane 2x + y − z = −1.

20. Determine the angle between the plane x+2y−z = 0 and the line (x, y, z) =
(3, 5, −1) + t(1, 1, 0).

21. A tetrahedron has corners A = (−1, 2, 0), B = (1, 3, −1), C(1, 1, 0), and
D(−1, 3, −2). Determine the angle between the plane containing the side
BCD and the line containing the edge AB.

4. Answers to Exercises
3. θ = 2π/3 √ √ p
5. The √side-lengths
√ are 3, 3, and 2. The cosines of angles are − 2/3,
5/(3 3), and 2 2/3.
6. a = ±2, b = ±4
7. π/3
√ or 2π/3.
8. 12.
√1, −1).
9. (1,
10. 3 3.
11. x + y − z = 0.
12. 1 and 25/13 respectively. The points
√ are on opposite sides of the plane.
13. a) 3x − 2y + z = 12. b) 1/ 14.
14. (1, −1, 1).
54 3. DISTANCES AND ANGLES


15. a) Intersection-point: (2, 1, 5). b) 16/ 30.
16. (2, 1, √
0). √
17. a) 1/ 14. b) 1/ 3.
18. x + 2y + 5z = −1.
19. a) x + 2y + z = 3. b) π/3.
20. π/3.
21. π/6.

You might also like