The Angle Formula

The angle between two lines is the angle between their direction vectors — position is irrelevant (for lines not through the origin, slide them there; parallel lines keep their direction). For lines with direction ratios a1,b1,c1a_1, b_1, c_1 and a2,b2,c2a_2, b_2, c_2, the acute angle θ\theta satisfies

cos⁡θ=∣a1a2+b1b2+c1c2∣a12+b12+c12 a22+b22+c22\cos\theta = \frac{\left|a_1a_2 + b_1b_2 + c_1c_2\right|}{\sqrt{a_1^2 + b_1^2 + c_1^2}\,\sqrt{a_2^2 + b_2^2 + c_2^2}}

In vector language, for r⃗=a⃗1+λb⃗1\vec{r} = \vec{a}_1 + \lambda\vec{b}_1 and r⃗=a⃗2+μb⃗2\vec{r} = \vec{a}_2 + \mu\vec{b}_2:

cos⁡θ=∣b⃗1⋅b⃗2∣∣b⃗1∣∣b⃗2∣\cos\theta = \frac{\left|\vec{b}_1 \cdot \vec{b}_2\right|}{\left|\vec{b}_1\right|\left|\vec{b}_2\right|}

The modulus enforces the convention that the angle between lines is taken acute (lines, unlike vectors, have no preferred direction). There is a matching sine form,

sin⁡θ=(a1b2−a2b1)2+(b1c2−b2c1)2+(c1a2−c2a1)2a12+b12+c12 a22+b22+c22\sin\theta = \frac{\sqrt{(a_1b_2 - a_2b_1)^2 + (b_1c_2 - b_2c_1)^2 + (c_1a_2 - c_2a_1)^2}}{\sqrt{a_1^2 + b_1^2 + c_1^2}\,\sqrt{a_2^2 + b_2^2 + c_2^2}}

(the numerator is ∣b⃗1×b⃗2∣\left|\vec{b}_1 \times \vec{b}_2\right|), and if direction cosines are given the denominators disappear entirely: cos⁡θ=∣l1l2+m1m2+n1n2∣\cos\theta = \left|l_1l_2 + m_1m_2 + n_1n_2\right|.

The two special cases

  1. Perpendicular lines (θ=90∘\theta = 90^\circ):

a1a2+b1b2+c1c2=0a_1a_2 + b_1b_2 + c_1c_2 = 0

  1. Parallel lines (θ=0∘\theta = 0^\circ):

a1a2=b1b2=c1c2\frac{a_1}{a_2} = \frac{b_1}{b_2} = \frac{c_1}{c_2}

Key Point (workflow): every angle question is three steps — extract both direction-ratio triples (standardising Cartesian forms first!), dot them, divide by the two norms. The only traps are unstandardised equations feeding wrong ratios in, and forgetting the modulus when the dot product comes out negative.

Solved Examples

Example 1: Angle from vector equations

Find the angle between the lines r⃗=3i^+2j^−4k^+λ(i^+2j^+2k^)\vec{r} = 3\hat{i} + 2\hat{j} - 4\hat{k} + \lambda\left(\hat{i} + 2\hat{j} + 2\hat{k}\right) and r⃗=5i^−2j^+μ(3i^+2j^+6k^)\vec{r} = 5\hat{i} - 2\hat{j} + \mu\left(3\hat{i} + 2\hat{j} + 6\hat{k}\right).

Solution:

  1. Direction vectors only: b⃗1=(1,2,2)\vec{b}_1 = (1, 2, 2), b⃗2=(3,2,6)\vec{b}_2 = (3, 2, 6) — the anchor points play no role.
  2. Dot and norms: b⃗1⋅b⃗2=3+4+12=19\vec{b}_1\cdot\vec{b}_2 = 3 + 4 + 12 = 19; ∣b⃗1∣=3\left|\vec{b}_1\right| = 3, ∣b⃗2∣=7\left|\vec{b}_2\right| = 7.
  3. Angle: cos⁡θ=1921\cos\theta = \dfrac{19}{21}.

Answer: θ=cos⁡−11921\theta = \cos^{-1}\dfrac{19}{21}.


Example 2: Angle from Cartesian equations

Find the angle between x+33=y−15=z+34\dfrac{x + 3}{3} = \dfrac{y - 1}{5} = \dfrac{z + 3}{4} and x+11=y−41=z−52\dfrac{x + 1}{1} = \dfrac{y - 4}{1} = \dfrac{z - 5}{2}.

Solution:

  1. Ratios: (3,5,4)(3, 5, 4) and (1,1,2)(1, 1, 2).
  2. Dot: 3+5+8=163 + 5 + 8 = 16; norms 50=52\sqrt{50} = 5\sqrt{2} and 6\sqrt{6}.
  3. Simplify: cos⁡θ=16512=16103=8315\cos\theta = \dfrac{16}{5\sqrt{12}} = \dfrac{16}{10\sqrt{3}} = \dfrac{8\sqrt{3}}{15}.

Answer: θ=cos⁡−18315\theta = \cos^{-1}\dfrac{8\sqrt{3}}{15} — rationalise the surd at the end, not the middle.


Example 3: A mutually perpendicular triple

Show that the lines with direction cosines (1213,−313,−413)\left(\dfrac{12}{13}, \dfrac{-3}{13}, \dfrac{-4}{13}\right), (413,1213,313)\left(\dfrac{4}{13}, \dfrac{12}{13}, \dfrac{3}{13}\right), (313,−413,1213)\left(\dfrac{3}{13}, \dfrac{-4}{13}, \dfrac{12}{13}\right) are mutually perpendicular.

Solution:

  1. First pair: 48−36−12169=0\dfrac{48 - 36 - 12}{169} = 0. ✓
  2. Second pair: 12−48+36169=0\dfrac{12 - 48 + 36}{169} = 0. ✓
  3. Third pair: 36+12−48169=0\dfrac{36 + 12 - 48}{169} = 0. ✓

Answer: each pairwise dot vanishes — the three lines are mutually perpendicular (and each triple is a genuine set of direction cosines: the squares sum to 169169=1\dfrac{169}{169} = 1).


Example 4: Perpendicular and parallel, via points

(i) Show that the line through (1,−1,2)(1, -1, 2) and (3,4,−2)(3, 4, -2) is perpendicular to the line through (0,3,2)(0, 3, 2) and (3,5,6)(3, 5, 6). (ii) Show that the line through (4,7,8)(4, 7, 8) and (2,3,4)(2, 3, 4) is parallel to the line through (−1,−2,1)(-1, -2, 1) and (1,2,5)(1, 2, 5).

Solution:

  1. (i) Ratios: (2,5,−4)(2, 5, -4) and (3,2,4)(3, 2, 4); dot =6+10−16=0= 6 + 10 - 16 = 0 — perpendicular. ✓
  2. (ii) Ratios: (−2,−4,−4)(-2, -4, -4) and (2,4,4)(2, 4, 4) — proportional (factor −1-1) — parallel. ✓

Answer: (i) perpendicular; (ii) parallel. Both tests run on coordinate differences with no equations needed.


Example 5: A parameter from perpendicularity (with standardising)

Find pp so that the lines 1−x3=7y−142p=z−32\dfrac{1 - x}{3} = \dfrac{7y - 14}{2p} = \dfrac{z - 3}{2} and 7−7x3p=y−51=6−z5\dfrac{7 - 7x}{3p} = \dfrac{y - 5}{1} = \dfrac{6 - z}{5} are at right angles.

Solution:

  1. Standardise the first: x−1−3=y−22p/7=z−32\dfrac{x - 1}{-3} = \dfrac{y - 2}{2p/7} = \dfrac{z - 3}{2} — ratios (−3,2p7,2)\left(-3, \dfrac{2p}{7}, 2\right).
  2. Standardise the second: x−1−3p/7=y−51=z−6−5\dfrac{x - 1}{-3p/7} = \dfrac{y - 5}{1} = \dfrac{z - 6}{-5} — ratios (−3p7,1,−5)\left(-\dfrac{3p}{7}, 1, -5\right).
  3. Perpendicularity: 9p7+2p7−10=0⇒11p7=10\dfrac{9p}{7} + \dfrac{2p}{7} - 10 = 0 \Rightarrow \dfrac{11p}{7} = 10.

Answer: p=7011p = \dfrac{70}{11}. Without standardising (7y7y, 1−x1 - x, 6−z6 - z all need fixing) every term of the dot product comes out wrong.


Example 6: An angle independent of the data

Find the angle between the lines whose direction ratios are (a,b,c)(a, b, c) and (b−c, c−a, a−b)(b - c, \ c - a, \ a - b).

Solution:

  1. Dot: a(b−c)+b(c−a)+c(a−b)=ab−ac+bc−ab+ca−cb=0a(b - c) + b(c - a) + c(a - b) = ab - ac + bc - ab + ca - cb = 0.

Answer: 90∘90^\circ, for every choice of a,b,ca, b, c — the algebra telescopes to zero identically.