Two lines in space rarely lie in the same flat plane the way lines on paper do, yet we can still measure the angle between them. This section of Three Dimensional Geometry gives you a clean formula for that angle, using either direction cosines or direction ratios, and also tells you exactly when two lines are perpendicular or parallel. Here’s a complete, exam-focused breakdown.

Setting Up the Idea

Take two lines L₁ and L₂, both imagined as passing through the origin (if they don’t originally pass through the origin, we mentally draw parallel lines through the origin — the angle stays the same). Let L₁ have direction ratios a₁, b₁, c₁ and L₂ have direction ratios a₂, b₂, c₂. The acute angle θ between them is what we want to find.

Because direction ratios behave exactly like vector components, the angle between the two lines is really the angle between two vectors — so the cosine formula from vector algebra applies directly.

Formula Using Direction Ratios

cos θ = |a₁a₂ + b₁b₂ + c₁c₂| / [√(a₁² + b₁² + c₁²) × √(a₂² + b₂² + c₂²)]

The modulus (absolute value) sign is essential — it guarantees θ comes out as the acute angle between the lines, which is the standard convention in this chapter.

Formula Using Direction Cosines

If the direction cosines l₁, m₁, n₁ and l₂, m₂, n₂ are already known (each set satisfying l² + m² + n² = 1), the formula simplifies to:

cos θ = |l₁l₂ + m₁m₂ + n₁n₂|

There’s also a sine version of the formula, useful in some derivations:

sin θ = √[(l₁m₂ − l₂m₁)² + (m₁n₂ − m₂n₁)² + (n₁l₂ − n₂l₁)²]

Conditions for Perpendicular and Parallel Lines

These two conditions are extremely exam-friendly and worth memorising exactly:

  • Perpendicular lines (θ = 90°): a₁a₂ + b₁b₂ + c₁c₂ = 0

  • Parallel lines (θ = 0°): a₁/a₂ = b₁/b₂ = c₁/c₂

Whenever a question mentions “perpendicular” or “parallel” lines with unknown constants, these two conditions are usually the fastest route to the answer.

Angle Between Lines Given in Vector Form

If two lines are given as r = a₁ + λb₁ and r = a₂ + μb₂, the angle between them uses only the direction vectors b₁ and b₂ (the position vectors a₁, a₂ don’t matter for the angle):

cos θ = |b₁ · b₂| / (|b₁| |b₂|)

Solved Examples

Example 1: Find the angle between the lines r = 3î + 2ĵ − 4k̂ + λ(î + 2ĵ + 2k̂) and r = 5î − 2ĵ + μ(3î + 2ĵ + 6k̂).

Solution: b₁ = î + 2ĵ + 2k̂, b₂ = 3î + 2ĵ + 6k̂

b₁ · b₂ = (1)(3) + (2)(2) + (2)(6) = 3 + 4 + 12 = 19

b₁= √(1+4+4) = 3,b₂= √(9+4+36) = 7

cos θ = |19| / (3 × 7) = 19/21

θ = cos⁻¹(19/21)

Example 2: Find the angle between the lines (x+3)/3 = (y−1)/5 = (z+3)/4 and (x+1)/1 = (y−4)/1 = (z−5)/2.

Solution: Direction ratios: (3, 5, 4) and (1, 1, 2)

cos θ = |3(1) + 5(1) + 4(2)| / [√(9+25+16) × √(1+1+4)] = |3 + 5 + 8| / (√50 × √6) = 16 / (5√2 × √6) = 16/(5√12) = 8√3/15

θ = cos⁻¹(8√3/15)

Where This Comes Up in Exams

The angle-between-lines formula is one of the most frequently tested results in this chapter — both directly (find θ between two given lines) and indirectly (find an unknown constant p given that two lines are perpendicular). CUET Commerce-stream Mathematics papers, along with IPMAT and other entrance tests, often frame this as a quick calculation-based MCQ, so speed and formula recall matter as much as understanding.

A common exam variation gives you direction cosines for one line and direction ratios for the other, forcing you to convert one set into the other before applying the formula. Another popular variation asks you to prove three given lines are “mutually perpendicular” — here you simply apply the perpendicularity condition three times, once for each pair of lines, and confirm that all three dot-product sums equal zero. Practising both variations separately, rather than only the standard “find θ” question, will make you far more comfortable with whatever version appears on your actual paper.

Study Smarter with ChampionsPrep

Formula recall under exam pressure is what separates a good score from a great one. ChampionsPrep’s AI-powered, chapter-wise practice sessions with PrepCoin packs from ₹59 help CBSE and Maharashtra Board Class XI–XII Commerce students drill the angle-between-lines formula until it’s second nature, alongside targeted prep for CUET, IPMAT, JIPMAT, NPAT, and SET. Start practising today at app.championsprep.in.

Angle Between Two Lines in 3D Geometry – Formulas and Examples podcast artwork
Audio LessonClass 12

Angle Between Two Lines in 3D Geometry – Formulas and Examples

ChampionsPrep MathematicsEpisode 1174:17

Subscribe in any podcast app:

Frequently Asked Questions

Why is the modulus sign used in the angle-between-lines formula? +

Because a line has two opposite directions, the raw dot product could come out negative. Taking the modulus ensures the calculated angle is always the acute angle between the lines.

How do you find the angle between two lines given in Cartesian form? +

Read off the direction ratios from the denominators of each line's Cartesian equation, then substitute them into the standard cosine formula for the angle between two lines.

What does it mean if a1a2 plus b1b2 plus c1c2 equals zero? +

It means the two lines are perpendicular to each other, with the angle between them equal to 90 degrees.

Do the position vectors affect the angle between two lines in vector form? +

No, only the direction vectors determine the angle between two lines; the position vectors only affect where the lines are located in space.

Can the angle between two lines be obtuse? +

By convention, the acute angle between two lines is always reported using the modulus in the formula, so the final answer lies between 0 and 90 degrees.