Pv1 - Scalar product and angles between vectors

Pv1 - Scalar product and angles between vectors

Turn two vectors into one number that reveals the angle between them. You will calculate scalar products in components, use their geometric form to find angles, and recognise perpendicular directions without drawing a three-dimensional picture.

A product that measures agreement

Two cables leave the same point in the directions (4,0)(4, 0) and (2,3)(2, 3). How can you find their angle without measuring a drawing?

The second cable travels 22 units along the first cable's direction and 33 units across it. The scalar product keeps the along-direction information: 4(2)+0(3)=84(2) + 0(3) = 8. By the end of the lesson, this number will give the angle exactly enough for any required accuracy.

You already know

For a=(a1a2a3)\mathbf{a} = \begin{pmatrix}a_1\\a_2\\a_3\end{pmatrix}, its magnitude is ∣a∣=a12+a22+a32|\mathbf{a}| = \sqrt{a_1^2+a_2^2+a_3^2}. A vector describes a displacement; its components can be positive, negative or zero.

Here is the picture behind the calculation. The dashed perpendicular separates movement along the blue vector from movement across it.

[DIAGRAM: asset_name: Scalar product and projection; asset_slug: scalar_product_projection; caption: Only the component along the first vector contributes to the scalar product; description: On equal Cartesian axes, blue vector a goes from the origin to (4,0), clay vector b goes to (2,3), and a dashed perpendicular reaches (2,0). A sage segment from the origin to (2,0) is labelled projection length 2. The angle theta is marked at the origin.]
Only the component along the first vector contributes to the scalar product

Scalar product

The scalar product of two vectors is the sum of the products of corresponding components. Its answer is a scalar, not a vector. For example, (1,0).(0,1)=0(1, 0).(0, 1) = 0, whereas the component-by-component list (0,0)(0, 0) is not a scalar product.

The same rule works with two or three components. A missing third component in a two-dimensional vector is simply zero.

Scalar product in components

For a=(a1a2a3)\mathbf{a} = \begin{pmatrix}a_1\\a_2\\a_3\end{pmatrix} and b=(b1b2b3)\mathbf{b} = \begin{pmatrix}b_1\\b_2\\b_3\end{pmatrix},

a.b=a1b1+a2b2+a3b3\mathbf{a}.\mathbf{b} = a_1b_1+a_2b_2+a_3b_3

Not in the formula booklet: learn it.

Pair corresponding components before adding. This avoids accidentally combining the first component of one vector with the second component of the other.

Worked example 1: a three-dimensional product

Question. Find a.b\mathbf{a}.\mathbf{b}, where a=(2−13)\mathbf{a} = \begin{pmatrix}2\\-1\\3\end{pmatrix} and b=(42−1)\mathbf{b} = \begin{pmatrix}4\\2\\-1\end{pmatrix}.

Plan. Multiply corresponding components, keeping negative entries in brackets, then add.

a.b=2(4)+(−1)(2)+3(−1)pair components=8−2−3evaluate products=3add\begin{aligned} \mathbf{a}.\mathbf{b} &= 2(4)+(-1)(2)+3(-1) && \text{pair components} \\ &= 8-2-3 && \text{evaluate products} \\ &= 3 && \text{add} \end{aligned}

Why this step? Brackets make the signs part of the components, so the last product is negative.

Answer. a.b=3\mathbf{a}.\mathbf{b} = 3.

Check. Reversing the order gives 4(2)+2(−1)+(−1)(3)=34(2)+2(-1)+(-1)(3) = 3 too.

Change just the sign of the final component of b\mathbf{b}. Writing the vectors with i\mathbf{i}, j\mathbf{j} and k\mathbf{k} changes their appearance, but not the calculation.

Worked example 2: the effect of one sign

Question. Find (2i−j+3k).(4i+2j+k)(2\mathbf{i}-\mathbf{j}+3\mathbf{k}).(4\mathbf{i}+2\mathbf{j}+\mathbf{k}).

Plan. Read the three coefficients as components and use the same product rule.

a.b=2(4)+(−1)(2)+3(1)match directions=8−2+3the last sign changes=9add\begin{aligned} \mathbf{a}.\mathbf{b} &= 2(4)+(-1)(2)+3(1) && \text{match directions} \\ &= 8-2+3 && \text{the last sign changes} \\ &= 9 && \text{add} \end{aligned}

Why this step? The coefficient of j\mathbf{j} in the first vector is −1-1, even though no numeral is printed beside it.

Answer. The scalar product is 99.

Check. The last contribution has changed from −3-3 to 33, so the total increases by 66, from 33 to 99.

A useful surprise is a.a=∣a∣2\mathbf{a}.\mathbf{a} = |\mathbf{a}|^2. In the first example this is 4+1+9=144+1+9 = 14. A scalar product with itself cannot be negative, although a product of different vectors can be.

Watch out

Wrong: (1,2,3).(4,5,6)=(4,10,18)(1, 2, 3).(4, 5, 6) = (4, 10, 18). Right: add those three products to obtain 3232. A dot product produces one number.

Now apply the same sign discipline to a fresh pair.

Finding the angle between vectors

The geometric form of the scalar product connects the components to an angle, so a numerical product becomes a geometrical tool.

If θ\theta is the angle from one non-zero vector to the other, taken between 00 and π\pi, the component of b\mathbf{b} along a\mathbf{a} is ∣b∣cos⁡θ|\mathbf{b}|\cos\theta. Multiplying it by ∣a∣|\mathbf{a}| gives the scalar product. In the cable picture, that component is 22, so the product is 4(2)=84(2) = 8.

Scalar product and angle

For non-zero vectors a\mathbf{a} and b\mathbf{b},

a.b=∣a∣ ∣b∣cos⁡θcos⁡θ=a.b∣a∣ ∣b∣\begin{aligned} \mathbf{a}.\mathbf{b} &= |\mathbf{a}|\,|\mathbf{b}|\cos\theta \\ \cos\theta &= \frac{\mathbf{a}.\mathbf{b}}{|\mathbf{a}|\,|\mathbf{b}|} \end{aligned}

Here 0≤θ≤π0 \le \theta \le \pi. The angle involving the zero vector is undefined.

Not in the formula booklet: learn it.

Keep the exact dot product and magnitudes until the final inverse cosine. A positive product gives an angle smaller than a right angle, including zero for the same direction. A negative product gives an angle greater than a right angle, including a straight angle for opposite directions.

Worked example 3: an acute angle

Question. Find the angle between a=(122)\mathbf{a} = \begin{pmatrix}1\\2\\2\end{pmatrix} and b=(212)\mathbf{b} = \begin{pmatrix}2\\1\\2\end{pmatrix}, in degrees to one decimal place.

Plan. Calculate the scalar product and both magnitudes, then use inverse cosine.

a.b=1(2)+2(1)+2(2)=8component form∣a∣=∣b∣=1+4+4=3magnitudescos⁡θ=83(3)=89geometric formθ=arccos⁡(89)=27.3∘degree mode\begin{aligned} \mathbf{a}.\mathbf{b} &= 1(2)+2(1)+2(2) = 8 && \text{component form} \\ |\mathbf{a}| = |\mathbf{b}| &= \sqrt{1+4+4} = 3 && \text{magnitudes} \\ \cos\theta &= \frac{8}{3(3)} = \frac89 && \text{geometric form} \\ \theta &= \arccos\left(\frac89\right) = 27.3^\circ && \text{degree mode} \end{aligned}

Why this step? Dividing by both lengths removes their scale, leaving only the angle.

Answer. 27.3∘27.3^\circ.

Check. The product is positive, so an acute answer is sensible.

Now reverse only the second vector. Its length stays the same, but the angle between the arrows must change.

Worked example 4: reversing one vector

Question. Find the angle between (122)\begin{pmatrix}1\\2\\2\end{pmatrix} and (−2−1−2)\begin{pmatrix}-2\\-1\\-2\end{pmatrix}, to one decimal place.

Plan. Retain the signs in the scalar product and calculate the full angle between the vectors.

a.b=−2−2−4=−8reversed components∣a∣ ∣b∣=3(3)=9unchanged lengthsθ=arccos⁡(−89)=152.7∘negative cosine\begin{aligned} \mathbf{a}.\mathbf{b} &= -2-2-4 = -8 && \text{reversed components} \\ |\mathbf{a}|\,|\mathbf{b}| &= 3(3) = 9 && \text{unchanged lengths} \\ \theta &= \arccos\left(-\frac89\right) = 152.7^\circ && \text{negative cosine} \end{aligned}

Why this step? Taking an absolute value would erase the reversal and give the wrong angle between these directed vectors.

Answer. 152.7∘152.7^\circ.

Check. 152.7∘+27.3∘=180.0∘152.7^\circ+27.3^\circ = 180.0^\circ, as reversing one arrow requires.

The distinction between an arrow and an undirected line becomes useful when you meet angles between lines later.

Watch out

Wrong: a negative scalar product means there is no angle. Right: it means cos⁡θ<0\cos\theta < 0, so the angle is greater than 90∘90^\circ: obtuse for non-parallel vectors, or 180∘180^\circ for opposite directions. Do not discard the sign.

The next vectors have a particularly tidy angle, although their components look unrelated.

Testing perpendicularity

A right angle makes the cosine zero, so perpendicularity is the simplest scalar-product test of all.

Perpendicular vectors

For two non-zero vectors,

a⊥b  ⟺  a.b=0\mathbf{a}\perp\mathbf{b} \iff \mathbf{a}.\mathbf{b} = 0

The zero vector has scalar product zero with every vector, but has no direction and defines no angle.

Not in the formula booklet: learn it.

This turns a spatial condition into an equation. You can find an unknown component without attempting a three-dimensional sketch.

Worked example 5: finding an unknown component

Question. The non-zero vectors (2−13)\begin{pmatrix}2\\-1\\3\end{pmatrix} and (k42)\begin{pmatrix}k\\4\\2\end{pmatrix} are perpendicular. Determine kk.

Plan. Set their scalar product equal to zero and solve the resulting linear equation.

2k+(−1)(4)+3(2)=0perpendicularity2k+2=0collect termsk=−1solve\begin{aligned} 2k+(-1)(4)+3(2) &= 0 && \text{perpendicularity} \\ 2k+2 &= 0 && \text{collect terms} \\ k &= -1 && \text{solve} \end{aligned}

Why this step? Perpendicularity fixes the scalar product, rather than fixing any individual component.

Answer. k=−1k = -1.

Check. 2(−1)−4+6=02(-1)-4+6 = 0, and neither vector is zero.

Now let the unknown occur in both vectors. The condition is unchanged, but the equation can have more than one answer.

Worked example 6: two perpendicular cases

Question. Determine the values of tt for which (t11)\begin{pmatrix}t\\1\\1\end{pmatrix} and (t−32)\begin{pmatrix}t\\-3\\2\end{pmatrix} are perpendicular.

Plan. Form the scalar product and solve the quadratic equation it produces.

t2−3+2=0set product to zerot2−1=0simplify(t−1)(t+1)=0factoriset=1 or −1both roots\begin{aligned} t^2-3+2 &= 0 && \text{set product to zero} \\ t^2-1 &= 0 && \text{simplify} \\ (t-1)(t+1) &= 0 && \text{factorise} \\ t &= 1\text{ or }-1 && \text{both roots} \end{aligned}

Why this step? The first components multiply to t2t^2, not 2t2t, so two values are possible.

Answer. t=±1t = \pm1.

Check. Both substitutions give 1−3+2=01-3+2 = 0. Both vectors remain non-zero.

Return to the cables: their scalar product is 88, their lengths are 44 and 13\sqrt{13}, so θ=arccos⁡(2/13)=56.3∘\theta = \arccos(2/\sqrt{13}) = 56.3^\circ to one decimal place. Their directions are neither parallel nor perpendicular.

Watch out

Wrong: perpendicular vectors have corresponding components whose products are all zero. Right: only their sum must be zero. Positive and negative contributions can cancel.

Keep the unknown in both first components in this final matched question.

Quick Recap

  • Multiply corresponding components and add to calculate a scalar product.
  • For non-zero vectors, divide the product by both magnitudes to find cos⁡θ\cos\theta.
  • Keep the sign: vector angles can be obtuse.
  • Non-zero vectors are perpendicular exactly when their scalar product is zero.

The two cable directions make an angle of 56.3∘56.3^\circ, found from their components rather than from a measured drawing.