• Foundation
  • About 16 min
  • 5 practice questions

Angle between two lines

Find the acute angle between two lines from their direction ratios, direction cosines or vector equations, and use the conditions for two lines to be perpendicular or parallel.

If something looks wrong, please tell us.

Two lines in space may not meet, yet they still have an angle between them: the angle between their directions. Since a direction is a vector, this angle comes straight from the scalar product of the previous chapter.

The formula

Let L₁ and L₂ have direction ratios a₁, b₁, c₁ and a₂, b₂, c₂. If they do not pass through the origin, take the parallel lines through the origin; parallel lines have the same directions, so the angle is unchanged. Points P(a₁, b₁, c₁) and Q(a₂, b₂, c₂) lie on these lines, so the angle θ between OP and OQ is given by the scalar product: cos θ = (a₁a₂ + b₁b₂ + c₁c₂)/[√(a₁² + b₁² + c₁²) √(a₂² + b₂² + c₂²)]. A line has no preferred sense, so we take the acute angle by using the absolute value.

cos θ = |a₁a₂ + b₁b₂ + c₁c₂| / [√(a₁² + b₁² + c₁²) √(a₂² + b₂² + c₂²)]. With direction cosines: cos θ = |l₁l₂ + m₁m₂ + n₁n₂|. For r = a₁ + λb₁ and r = a₂ + μb₂: cos θ = |b₁ · b₂| / (|b₁| |b₂|).

The angle can also be given by its sine: sin θ = √[(a₁b₂ − a₂b₁)² + (b₁c₂ − b₂c₁)² + (c₁a₂ − c₂a₁)²] / [√(a₁² + b₁² + c₁²) √(a₂² + b₂² + c₂²)], which is |b₁ × b₂|/(|b₁| |b₂|) in vector language.

Perpendicular and parallel lines

Two special cases

  • Perpendicular (θ = 90°)
    • cos θ = 0
    • a₁a₂ + b₁b₂ + c₁c₂ = 0
    • b₁ · b₂ = 0
  • Parallel (θ = 0)
    • sin θ = 0
    • a₁/a₂ = b₁/b₂ = c₁/c₂
    • b₁ × b₂ = 0

Worked examples

Worked example 1: vector form

Find the angle between r = (î + ĵ) + λ(2î + 2ĵ + k̂) and r = (3î − k̂) + μ(4î + ĵ + 8k̂). b₁ · b₂ = 8 + 2 + 8 = 18; |b₁| = √(4 + 4 + 1) = 3; |b₂| = √(16 + 1 + 64) = 9. cos θ = 18/27 = 2/3, so θ = cos⁻¹(2/3).

Worked example 2: Cartesian form

Find the angle between (x − 1)/1 = (y + 2)/2 = (z − 3)/2 and (x + 1)/3 = y/0 = (z − 4)/4. Direction ratios: 1, 2, 2 and 3, 0, 4. (A zero denominator just means that coordinate is constant along the line; here y = 0.) Sum of products: 3 + 0 + 8 = 11. Magnitudes: 3 and 5. cos θ = 11/15, so θ = cos⁻¹(11/15).

Worked example 3: a perpendicularity condition

Find p so that lines with direction ratios 2, p, 3 and 1, −2, 4 are perpendicular. We need 2(1) + p(−2) + 3(4) = 0, i.e. 14 − 2p = 0, so p = 7.

Worked example 4: parallel lines

Show that the line through (1, 0, 2) and (3, −3, 8) is parallel to the line with direction ratios −4, 6, −12. Direction ratios of the first line: 2, −3, 6. Ratios: −4/2 = −2, 6/(−3) = −2, −12/6 = −2, all equal. So the lines are parallel.

Worked example 5: using direction cosines

Two lines have direction cosines 1/√2, 1/√2, 0 and 0, 1/√2, 1/√2. cos θ = |0 + 1/2 + 0| = 1/2, so θ = 60°.

Key takeaways

  • The angle between two lines is the angle between their direction vectors, taken acute.
  • cos θ = |a₁a₂ + b₁b₂ + c₁c₂| divided by the product of the two magnitudes.
  • Perpendicular: a₁a₂ + b₁b₂ + c₁c₂ = 0. Parallel: a₁/a₂ = b₁/b₂ = c₁/c₂.
  • Only the direction ratios matter; the points on the lines do not affect the angle.
  • Put the Cartesian equations in standard form before reading the direction ratios.

Check your understanding

  1. 1. What is the angle between two lines with direction ratios 2, 2, 1 and 1, 2, 2?

    1. cos⁻¹(8/9)
    2. cos⁻¹(4/9)
    3. cos⁻¹(2/3)
    4. π/4
    Show answer

    Answer: A. Sum of products: 2 + 4 + 2 = 8. Each magnitude is √9 = 3. cos θ = 8/(3 × 3) = 8/9, so θ = cos⁻¹(8/9).

  2. 2. Which pair of direction ratios gives perpendicular lines?

    1. 1, 2, 3 and 2, 4, 6
    2. 1, 2, 3 and 3, 0, −1
    3. 1, 1, 1 and 1, 1, −1
    4. 2, 1, 0 and 1, 2, 0
    Show answer

    Answer: B. For 1, 2, 3 and 3, 0, −1: 3 + 0 − 3 = 0, so the lines are perpendicular. The other sums are 28, 1 and 4.

  3. 3. For what k are the lines (x − 2)/3 = (y + 1)/k = z/2 and x/1 = (y − 3)/2 = (z + 1)/(−4) perpendicular?

    1. −5/2
    2. 2
    3. 5
    4. 5/2
    Show answer

    Answer: D. Direction ratios 3, k, 2 and 1, 2, −4. Perpendicular: 3 + 2k − 8 = 0, so 2k = 5 and k = 5/2.

  4. 4. The lines (x − 1)/2 = (y + 1)/(−1) = z/3 and (x + 2)/(−6) = y/3 = (z − 5)/(−9) are

    1. perpendicular
    2. inclined at 60°
    3. parallel
    4. inclined at 45°
    Show answer

    Answer: C. Direction ratios 2, −1, 3 and −6, 3, −9. Since −6/2 = 3/(−1) = −9/3 = −3, they are proportional and the lines are parallel.

  5. 5. Assertion (A): The angle θ between lines with direction ratios a₁, b₁, c₁ and a₂, b₂, c₂ is given by cos θ = |a₁a₂ + b₁b₂ + c₁c₂| / [√(a₁² + b₁² + c₁²) √(a₂² + b₂² + c₂²)]. Reason (R): A line has no preferred sense, so the angle between two lines is taken to be acute, and the absolute value makes cos θ ≥ 0.

    1. Both A and R are true, and R is the correct explanation of A
    2. Both A and R are true, but R is not the correct explanation of A
    3. A is true, but R is false
    4. A is false, but R is true
    Show answer

    Answer: A. Without the modulus the formula would give the angle between two chosen directions, which could be obtuse. Reversing either direction gives the supplementary angle. R explains why the absolute value appears in A.

Sign in to keep track of the lessons you finish.

Next lesson → Shortest distance between two lines

Privacy · Terms · Refunds · Delivery