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,c1 and a2,b2,c2, the acute angle θ satisfies
In vector language, for r=a1+λb1 and r=a2+μb2:
cosθ=b1b2b1⋅b2
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,
(the numerator is b1×b2), and if direction cosines are given the denominators disappear entirely: cosθ=∣l1l2+m1m2+n1n2∣.
The two special cases
Perpendicular lines (θ=90∘):
a1a2+b1b2+c1c2=0
Parallel lines (θ=0∘):
a2a1=b2b1=c2c1
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^) and r=5i^−2j^+μ(3i^+2j^+6k^).
Solution:
Direction vectors only:b1=(1,2,2), b2=(3,2,6) — the anchor points play no role.
Dot and norms:b1⋅b2=3+4+12=19; b1=3, b2=7.
Angle:cosθ=2119.
Answer:θ=cos−12119.
Example 2: Angle from Cartesian equations
Find the angle between 3x+3=5y−1=4z+3 and 1x+1=1y−4=2z−5.
Solution:
Ratios:(3,5,4) and (1,1,2).
Dot:3+5+8=16; norms 50=52 and 6.
Simplify:cosθ=51216=10316=1583.
Answer:θ=cos−11583 — rationalise the surd at the end, not the middle.
Example 3: A mutually perpendicular triple
Show that the lines with direction cosines (1312,13−3,13−4), (134,1312,133), (133,13−4,1312) are mutually perpendicular.
Solution:
First pair:16948−36−12=0. ✓
Second pair:16912−48+36=0. ✓
Third pair:16936+12−48=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).
Example 4: Perpendicular and parallel, via points
(i) Show that the line through (1,−1,2) and (3,4,−2) is perpendicular to the line through (0,3,2) and (3,5,6). (ii) Show that the line through (4,7,8) and (2,3,4) is parallel to the line through (−1,−2,1) and (1,2,5).
Solution:
(i) Ratios:(2,5,−4) and (3,2,4); dot =6+10−16=0 — perpendicular. ✓
(ii) Ratios:(−2,−4,−4) and (2,4,4) — proportional (factor −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 p so that the lines 31−x=2p7y−14=2z−3 and 3p7−7x=1y−5=56−z are at right angles.
Solution:
Standardise the first:−3x−1=2p/7y−2=2z−3 — ratios (−3,72p,2).
Standardise the second:−3p/7x−1=1y−5=−5z−6 — ratios (−73p,1,−5).
Perpendicularity:79p+72p−10=0⇒711p=10.
Answer:p=1170. Without standardising (7y, 1−x, 6−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) and (b−c,c−a,a−b).
Solution:
Dot:a(b−c)+b(c−a)+c(a−b)=ab−ac+bc−ab+ca−cb=0.
Answer:90∘, for every choice of a,b,c — the algebra telescopes to zero identically.
Ready to test your knowledge?
Take a quick interactive quiz on this topic —
free, works without login.