The Scalar Product

A2 · P3 · 4 min

The scalar (dot) product multiplies two vectors to give a number, and that number encodes the angle between them. It answers "what is the angle?", "are these perpendicular?", and "where is the closest point?" in a few lines each.

Definition and the angle formula

Key result
a⋅b=a1b1+a2b2+a3b3=∣a∣∣b∣cos⁡θ\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3 = |\mathbf{a}||\mathbf{b}|\cos\theta

where θ\theta is the angle between the vectors. Hence

cos⁡θ=a⋅b∣a∣∣b∣,\cos\theta = \frac{\mathbf{a} \cdot \mathbf{b}}{|\mathbf{a}||\mathbf{b}|},

and a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0 exactly when the (non-zero) vectors are perpendicular. Also a⋅a=∣a∣2\mathbf{a} \cdot \mathbf{a} = |\mathbf{a}|^2.

Angle between two vectors

Find the angle between a=2i−j+2k\mathbf{a} = 2\mathbf{i} - \mathbf{j} + 2\mathbf{k} and b=i+2j−2k\mathbf{b} = \mathbf{i} + 2\mathbf{j} - 2\mathbf{k}.

Solution

a⋅b=2−2−4=−4\mathbf{a} \cdot \mathbf{b} = 2 - 2 - 4 = -4; ∣a∣=3|\mathbf{a}| = 3, ∣b∣=3|\mathbf{b}| = 3.

cos⁡θ=−49\cos\theta = -\tfrac{4}{9}, so θ=116.4∘\theta = 116.4^\circ.

Perpendicular vectors

Find the value of kk for which (k2−1)\begin{pmatrix} k \\ 2 \\ -1 \end{pmatrix} and (3k4)\begin{pmatrix} 3 \\ k \\ 4 \end{pmatrix} are perpendicular.

Solution

3k+2k−4=0⇒k=453k + 2k - 4 = 0 \Rightarrow k = \tfrac{4}{5}.

Angle between two lines

The angle between lines is the angle between their direction vectors. If the formula gives an obtuse angle, the acute angle 180∘−θ180^\circ - \theta is usually what is wanted; state which you are giving.

Angle between lines

Find the acute angle between r=a+s(110)\mathbf{r} = \mathbf{a} + s\begin{pmatrix} 1 \\ 1 \\ 0 \end{pmatrix} and r=c+t(2−12)\mathbf{r} = \mathbf{c} + t\begin{pmatrix} 2 \\ -1 \\ 2 \end{pmatrix}.

Solution

cos⁡θ=2−1+029=132\cos\theta = \dfrac{2 - 1 + 0}{\sqrt{2}\sqrt{9}} = \dfrac{1}{3\sqrt{2}}, so θ=76.4∘\theta = 76.4^\circ.

Angle in a triangle

For the angle at BB in triangle ABCABC, use BA→\overrightarrow{BA} and BC→\overrightarrow{BC}: both vectors must start at the vertex.

Angle at a vertex

A(1,2,3)A(1, 2, 3), B(4,2,7)B(4, 2, 7), C(4,5,3)C(4, 5, 3). Find angle ABCABC.

Solution

BA→=(−30−4)\overrightarrow{BA} = \begin{pmatrix} -3 \\ 0 \\ -4 \end{pmatrix}, BC→=(03−4)\overrightarrow{BC} = \begin{pmatrix} 0 \\ 3 \\ -4 \end{pmatrix}.

cos⁡B=0+0+165×5=1625\cos B = \dfrac{0 + 0 + 16}{5 \times 5} = \dfrac{16}{25}, so B=50.2∘B = 50.2^\circ.

Foot of the perpendicular from a point to a line

Method
  1. Write the general point on the line, PP, in terms of the parameter tt.
  2. Form the vector from the given point QQ to PP: QP→=p−q\overrightarrow{QP} = \mathbf{p} - \mathbf{q}.
  3. At the foot of the perpendicular, QP→\overrightarrow{QP} is perpendicular to the direction vector: set QP→⋅b=0\overrightarrow{QP} \cdot \mathbf{b} = 0 and solve for tt.
  4. Substitute back for the foot; the distance from QQ to the line is ∣QP→∣|\overrightarrow{QP}| at that tt.
Shortest distance from a point to a line

Find the foot of the perpendicular from Q(3,1,−2)Q(3, 1, -2) to the line r=(102)+t(2−11)\mathbf{r} = \begin{pmatrix} 1 \\ 0 \\ 2 \end{pmatrix} + t\begin{pmatrix} 2 \\ -1 \\ 1 \end{pmatrix}, and the distance from QQ to the line.

Solution

General point P=(1+2t,−t,2+t)P = (1 + 2t, -t, 2 + t). QP→=(2t−2−t−1t+4)\overrightarrow{QP} = \begin{pmatrix} 2t - 2 \\ -t - 1 \\ t + 4 \end{pmatrix}.

Perpendicular to the direction: 2(2t−2)−(−t−1)+(t+4)=0⇒4t−4+t+1+t+4=0⇒6t+1=0⇒t=−162(2t - 2) - (-t - 1) + (t + 4) = 0 \Rightarrow 4t - 4 + t + 1 + t + 4 = 0 \Rightarrow 6t + 1 = 0 \Rightarrow t = -\tfrac{1}{6}.

Foot: (23,16,116)\left(\tfrac{2}{3}, \tfrac{1}{6}, \tfrac{11}{6}\right). QP→=(−73−56236)\overrightarrow{QP} = \begin{pmatrix} -\tfrac{7}{3} \\ -\tfrac{5}{6} \\ \tfrac{23}{6} \end{pmatrix}, distance =19636+2536+52936=75036=5306≈4.56= \sqrt{\tfrac{196}{36} + \tfrac{25}{36} + \tfrac{529}{36}} = \sqrt{\tfrac{750}{36}} = \tfrac{5\sqrt{30}}{6} \approx 4.56.

Problems with solids

Cuboids, pyramids and prisms are set up with the origin at a corner and axes along edges. Write each vertex as a position vector, then everything above applies.

Angle in a cuboid

A cuboid has OO at one corner, A(6,0,0)A(6, 0, 0), C(0,4,0)C(0, 4, 0), D(0,0,3)D(0, 0, 3) along the edges, and GG the vertex opposite OO. Find the angle between the diagonal OGOG and the edge OAOA.

Solution

g=(643)\mathbf{g} = \begin{pmatrix} 6 \\ 4 \\ 3 \end{pmatrix}, a=(600)\mathbf{a} = \begin{pmatrix} 6 \\ 0 \\ 0 \end{pmatrix}. cos⁡θ=3661×6=661\cos\theta = \dfrac{36}{\sqrt{61} \times 6} = \dfrac{6}{\sqrt{61}}, so θ=39.8∘\theta = 39.8^\circ.

Watch out

The scalar product of two vectors is a number. If your answer to a⋅b\mathbf{a} \cdot \mathbf{b} is a vector, you have multiplied component-wise without adding.

Exam tip

When the question gives an angle and asks for a value of an unknown, you will get a quadratic from cos⁡θ=a⋅b∣a∣∣b∣\cos\theta = \dfrac{\mathbf{a} \cdot \mathbf{b}}{|\mathbf{a}||\mathbf{b}|} after squaring. Squaring can introduce a false root with the wrong sign of the dot product, so check both candidates.

Practice

Question
  1. Find the angle between 3i+4k3\mathbf{i} + 4\mathbf{k} and i−2j+2k\mathbf{i} - 2\mathbf{j} + 2\mathbf{k}.
  2. Show that the lines r=a+s(i+2j−k)\mathbf{r} = \mathbf{a} + s(\mathbf{i} + 2\mathbf{j} - \mathbf{k}) and r=c+t(3i−j+k)\mathbf{r} = \mathbf{c} + t(3\mathbf{i} - \mathbf{j} + \mathbf{k}) are perpendicular.
  3. Find the foot of the perpendicular from the origin to the line r=(122)+t(10−1)\mathbf{r} = \begin{pmatrix} 1 \\ 2 \\ 2 \end{pmatrix} + t\begin{pmatrix} 1 \\ 0 \\ -1 \end{pmatrix}.
  4. P(2,1,0)P(2, 1, 0), Q(4,3,−1)Q(4, 3, -1), R(1,3,2)R(1, 3, 2). Find angle PQRPQR.
Answers
  1. cos⁡θ=3+85×3=1115\cos\theta = \dfrac{3 + 8}{5 \times 3} = \tfrac{11}{15}, θ=42.8∘\theta = 42.8^\circ.
  2. 3−2−1=03 - 2 - 1 = 0.
  3. P=(1+t,2,2−t)P = (1 + t, 2, 2 - t); p⋅(10−1)=1+t−2+t=0⇒t=12\mathbf{p} \cdot \begin{pmatrix} 1 \\ 0 \\ -1 \end{pmatrix} = 1 + t - 2 + t = 0 \Rightarrow t = \tfrac{1}{2}; foot (32,2,32)\left(\tfrac{3}{2}, 2, \tfrac{3}{2}\right).
  4. QP→=(−2−21)\overrightarrow{QP} = \begin{pmatrix} -2 \\ -2 \\ 1 \end{pmatrix}, QR→=(−303)\overrightarrow{QR} = \begin{pmatrix} -3 \\ 0 \\ 3 \end{pmatrix}; cos⁡Q=6+33×32=12\cos Q = \dfrac{6 + 3}{3 \times 3\sqrt{2}} = \tfrac{1}{\sqrt{2}}, Q=45∘Q = 45^\circ.

How well do you know this?

Builds on

Console

Search notes, courses and tools, or run an action