4.04c - Scalar product and angles between lines

4.04c - Scalar product and angles between lines

Use the scalar product to measure the angle between vectors, find the acute angle between lines and test perpendicularity. You will connect the coordinate calculation to its geometric meaning, then use perpendicularity to determine unknown components.

Calculating a scalar product

The vectors (1,2)(1,2) and (−1,−2)(-1,-2) point in opposite directions, yet they are directions of the same straight line. How can their vector angle be π\pi while their line angle is zero? The scalar product measures the arrows first; then you decide which angle the question asks for.

You already know

A line has equation r=a+λd\mathbf{r}=\mathbf{a}+\lambda\mathbf{d}, with non-zero direction d\mathbf{d}. The magnitude of (x,y,z)(x,y,z) is x2+y2+z2\sqrt{x^2+y^2+z^2}. Non-zero multiples of a direction vector describe parallel directions, even when the multiple is negative.

Start with two familiar perpendicular directions. Moving 3 units east and 4 units north gives vectors (3,0)(3,0) and (0,4)(0,4). Multiplying corresponding components and adding gives 3(0)+0(4)=03(0)+0(4)=0. For (3,0)(3,0) and (4,0)(4,0), the same calculation gives 12; reversing the second vector gives −12-12. The sign is already telling you something about the angle.

Scalar product

The scalar product of two vectors is the number obtained by multiplying corresponding components and adding:

(a1a2a3)⋅(b1b2b3)=a1b1+a2b2+a3b3\begin{pmatrix}a_1\\a_2\\a_3\end{pmatrix}\cdot\begin{pmatrix}b_1\\b_2\\b_3\end{pmatrix} =a_1b_1+a_2b_2+a_3b_3

In two dimensions, omit the third term. It is a scalar, not a vector: for example, (2,1)⋅(3,−4)=2(2,1)\cdot(3,-4)=2, not (6,−4)(6,-4).

The coordinate rule is not in the formula booklet: learn it. It also shows that order does not matter: a⋅b=b⋅a\mathbf{a}\cdot\mathbf{b}=\mathbf{b}\cdot\mathbf{a}. In particular, a⋅a=∣a∣2\mathbf{a}\cdot\mathbf{a}=|\mathbf{a}|^2. These identities are not in the formula booklet: learn them. A vector's scalar product with itself is zero only for the zero vector.

Worked example 1: two components

Question. Find a⋅b\mathbf{a}\cdot\mathbf{b}, where a=2i−j\mathbf{a}=2\mathbf{i}-\mathbf{j} and b=3i+4j\mathbf{b}=3\mathbf{i}+4\mathbf{j}.

Plan. Multiply corresponding components, then add.

a⋅b=(2)(3)+(−1)(4)pair matching components=6−4=2add the products\begin{aligned} \mathbf{a}\cdot\mathbf{b}&=(2)(3)+(-1)(4) && \text{pair matching components}\\ &=6-4=2 && \text{add the products} \end{aligned}

Why this step? The scalar product pairs the same coordinate directions; there are no cross terms such as (2)(4)(2)(4).

Answer. a⋅b=2\mathbf{a}\cdot\mathbf{b}=2.

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

Worked example 2 changes one feature: both vectors gain a third component. Include one more product, with its sign intact.

Worked example 2: three components

Question. Find a⋅b\mathbf{a}\cdot\mathbf{b}, where a=2i−j+3k\mathbf{a}=2\mathbf{i}-\mathbf{j}+3\mathbf{k} and b=3i+4j−2k\mathbf{b}=3\mathbf{i}+4\mathbf{j}-2\mathbf{k}.

Plan. Add the three products of corresponding components.

a⋅b=(2)(3)+(−1)(4)+(3)(−2)three matching pairs=6−4−6=−4keep negative signs\begin{aligned} \mathbf{a}\cdot\mathbf{b}&=(2)(3)+(-1)(4)+(3)(-2) && \text{three matching pairs}\\ &=6-4-6=-4 && \text{keep negative signs} \end{aligned}

Why this step? The third product is negative, so the extra component changes the sign of the whole scalar product.

Answer. a⋅b=−4\mathbf{a}\cdot\mathbf{b}=-4.

Check. b⋅a=6−4−6=−4\mathbf{b}\cdot\mathbf{a}=6-4-6=-4; the result is a number, as required.

The component calculation ends with one number.

Watch out

Wrong: (2,−1,3)⋅(3,4,−2)=(6,−4,−6)(2,-1,3)\cdot(3,4,-2)=(6,-4,-6). Those are three intermediate products. Right: add them to get the scalar product −4-4.

Next we explain why its sign carries information about direction.

Angles between vectors and lines

The scalar product joins coordinate arithmetic to geometry through the cosine of the angle between two arrows placed tail to tail.

To see why, let the angle be θ\theta. The cosine rule for the triangle with sides a\mathbf{a}, b\mathbf{b} and a−b\mathbf{a}-\mathbf{b} gives

∣a−b∣2=∣a∣2+∣b∣2−2∣a∣∣b∣cos⁡θ|\mathbf{a}-\mathbf{b}|^2=|\mathbf{a}|^2+|\mathbf{b}|^2-2|\mathbf{a}||\mathbf{b}|\cos\theta

Expanding the left side component by component instead gives ∣a∣2+∣b∣2−2a⋅b|\mathbf{a}|^2+|\mathbf{b}|^2-2\mathbf{a}\cdot\mathbf{b}. Comparing the expressions gives the result below. An acute vector angle therefore gives a positive product; an obtuse one gives a negative product.

Angle between two vectors

For non-zero vectors a\mathbf{a} and b\mathbf{b}, with 0≤θ≤π0\le\theta\le\pi,

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

Not in the formula booklet: learn it.

For lines, use their direction vectors, not their position vectors. An undirected line has two opposite choices of direction. Unless a particular obtuse angle is requested, take the smaller angle α\alpha, between zero and π/2\pi/2, by using the absolute value:

cos⁡α=∣d1⋅d2∣∣d1∣∣d2∣\cos\alpha=\frac{|\mathbf{d}_1\cdot\mathbf{d}_2|}{|\mathbf{d}_1||\mathbf{d}_2|}

This line-angle form is not in the formula booklet: learn it. It measures angles between non-intersecting lines too: translate the direction arrows to a common tail.

[DIAGRAM: asset_name: Vector angles and line angles; asset_slug: h245_4_04c_vector_line_angles; caption: Reversing one arrow replaces theta by pi minus theta, while the smaller angle between the lines stays the same; description: Two side-by-side equal-scale diagrams of the same pair of intersecting lines. The first shows arrows u and v with an acute angle theta. The second reverses v, showing the obtuse vector angle pi minus theta on the unchanged lines.]
Reversing one arrow replaces theta by pi minus theta, while the smaller angle between the lines stays the same

Worked example 3: the angle between two arrows

Question. Find the angle between a=(1,2,2)\mathbf{a}=(1,2,2) and b=(2,2,1)\mathbf{b}=(2,2,1), in radians to 3 significant figures.

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

a⋅b=2+4+2=8matching components∣a∣=∣b∣=1+4+4=3Pythagorascos⁡θ=83×3=89angle formulaθ=cos⁡−1 ⁣(89)≈0.476radian mode\begin{aligned} \mathbf{a}\cdot\mathbf{b}&=2+4+2=8 && \text{matching components}\\ |\mathbf{a}|=|\mathbf{b}|&=\sqrt{1+4+4}=3 && \text{Pythagoras}\\ \cos\theta&=\frac{8}{3\times3}=\frac89 && \text{angle formula}\\ \theta&=\cos^{-1}\!\left(\frac89\right)\approx0.476 && \text{radian mode} \end{aligned}

Why this step? Dividing by both magnitudes removes the lengths, leaving information about angle alone.

Answer. θ=0.476\theta=0.476 radians.

Check. The scalar product is positive, so an acute angle is expected; 0.476<π/20.476<\pi/2.

Worked example 4 changes one feature: the second direction is reversed. Its magnitude stays 3, while the scalar product changes sign.

Worked example 4: opposite directions on the same lines

Question. Two lines have direction vectors a=(1,2,2)\mathbf{a}=(1,2,2) and c=(−2,−2,−1)\mathbf{c}=(-2,-2,-1). Find the angle between these vectors and the acute angle between the lines.

Plan. Calculate the vector angle with its sign, then take its supplement for the acute line angle.

a⋅c=−2−4−2=−8reverse one vectorcos⁡θ=−89both magnitudes 3θ=cos⁡−1 ⁣(−89)≈2.67vector angleα=π−θ≈0.476use unrounded θ\begin{aligned} \mathbf{a}\cdot\mathbf{c}&=-2-4-2=-8 && \text{reverse one vector}\\ \cos\theta&=-\frac89 && \text{both magnitudes }3\\ \theta&=\cos^{-1}\!\left(-\frac89\right)\approx2.67 && \text{vector angle}\\ \alpha&=\pi-\theta\approx0.476 && \text{use unrounded }\theta \end{aligned}

Why this step? Choosing the opposite direction along a line leaves its inclination unchanged. The acute angle is the same as in the previous example.

Answer. The vector angle is 2.672.67 radians; the acute line angle is 0.4760.476 radians.

Check. Directly, α=cos⁡−1(∣−8∣/9)=cos⁡−1(8/9)\alpha=\cos^{-1}(|-8|/9)=\cos^{-1}(8/9).

Starting points tell you where the lines are; directions tell you their angle.

Watch out

Wrong: using a1⋅a2\mathbf{a}_1\cdot\mathbf{a}_2 for lines r=a1+λd1\mathbf{r}=\mathbf{a}_1+\lambda\mathbf{d}_1 and r=a2+μd2\mathbf{r}=\mathbf{a}_2+\mu\mathbf{d}_2. Starting points depend on your choice and do not determine the angle. Right: use d1\mathbf{d}_1 and d2\mathbf{d}_2.

Keep exact scalar products and square roots until the final calculator step. For a “show that” involving an exact trigonometric value, display the exact simplification as well.

Testing perpendicularity

For a right angle, the scalar-product test becomes particularly simple: the cosine is zero, so the scalar product is zero.

Perpendicularity test

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

a⊥b⟺a⋅b=0\mathbf{a}\perp\mathbf{b}\quad\Longleftrightarrow\quad\mathbf{a}\cdot\mathbf{b}=0

Not in the formula booklet: learn it.

The non-zero condition matters. The zero vector has scalar product zero with every vector, but no direction, so no angle can be assigned to it. For two lines, a zero scalar product of their directions means their directions are at right angles; it does not establish that the lines intersect.

Worked example 5: an unknown component

Question. Determine kk so that u=(2,−1,3)\mathbf{u}=(2,-1,3) and v=(k,12,2)\mathbf{v}=(k,12,2) are perpendicular.

Plan. Set their scalar product equal to zero and solve for kk.

u⋅v=2k−12+6multiply components2k−6=0perpendicular directionsk=3solve\begin{aligned} \mathbf{u}\cdot\mathbf{v}&=2k-12+6 && \text{multiply components}\\ 2k-6&=0 && \text{perpendicular directions}\\ k&=3 && \text{solve} \end{aligned}

Why this step? Perpendicularity supplies one numerical equation, so it can determine the unknown component.

Answer. k=3k=3.

Check. (2)(3)+(−1)(12)+(3)(2)=6−12+6=0(2)(3)+(-1)(12)+(3)(2)=6-12+6=0; both vectors are non-zero.

Worked example 6 changes one feature: the first component of u\mathbf{u} also becomes kk. A product of two unknown components now creates a quadratic, so there may be more than one answer.

Worked example 6: a quadratic condition

Question. Determine the real values of kk for which u=(k,−1,3)\mathbf{u}=(k,-1,3) and v=(k,12,2)\mathbf{v}=(k,12,2) are perpendicular.

Plan. Form the scalar product, set it equal to zero and solve the resulting quadratic.

u⋅v=k2−12+6first product is k2k2−6=0perpendicularityk=±6both square roots\begin{aligned} \mathbf{u}\cdot\mathbf{v}&=k^2-12+6 && \text{first product is }k^2\\ k^2-6&=0 && \text{perpendicularity}\\ k&=\pm\sqrt6 && \text{both square roots} \end{aligned}

Why this step? Both positive and negative values square to 6. Discarding the negative root loses a valid perpendicular pair.

Answer. k=6k=\sqrt6 or k=−6k=-\sqrt6.

Check. For either value, k2−12+6=0k^2-12+6=0. Neither vector can be zero because its other components are fixed and non-zero.

There is no need to calculate an inverse cosine when the required angle is a right angle.

Watch out

Wrong: u⋅v=1\mathbf{u}\cdot\mathbf{v}=1 for perpendicular vectors. It is cos⁡0=1\cos0=1 for directions pointing the same way, while cos⁡(π/2)=0\cos(\pi/2)=0. Right: set the scalar product to zero for perpendicularity.

Return to the opening puzzle. The product of (1,2)(1,2) and (−1,−2)(-1,-2) is −5-5, and both magnitudes are 5\sqrt5, so the vector angle has cosine −1-1 and is π\pi. For the lines, the absolute value gives cosine 1 and angle zero. Two arrows can face opposite ways along the very same line.

Quick Recap

  • A scalar product is a number: multiply corresponding components and add.
  • For non-zero vectors, divide the scalar product by both magnitudes to obtain the cosine of their vector angle.
  • For the smaller angle between lines, use their direction vectors and the absolute value of their scalar product.
  • Non-zero vectors are perpendicular exactly when their scalar product is zero.

Opposite direction vectors have vector angle π\pi, but their undirected lines have angle zero.