On this page
Two lines in space usually don't meet, so you can't just put a protractor where they cross. You don't need to. The angle between two lines depends only on their directions, and in three dimensions a direction is written as three numbers: the direction ratios.
What is the formula for the angle between two lines in 3D?
The NCERT Class 12 mathematics textbook, Chapter 11 (Three Dimensional Geometry) defines direction ratios as any three numbers proportional to the direction cosines of a line. So 2, −1, 2 and 4, −2, 4 describe the same direction.
For two lines with direction ratios a1, b1, c1 and a2, b2, c2, Section 11.4 of that chapter gives the acute angle θ between them as:
cos θ = |a1a2 + b1b2 + c1c2| / ( √(a1² + b1² + c1²) × √(a2² + b2² + c2²) )
If you know vectors, you will recognise this. The top is the dot product of the two direction vectors, and the bottom is the product of their lengths. It is the same idea as finding the angle between two vectors with the dot product, with one extra step: the absolute value.
The same NCERT section notes that if the lines don't pass through the origin, you can take parallel lines through the origin instead. Only direction matters, so the formula works even for skew lines that never touch.
Why take the absolute value for the acute angle?
A line has no arrow on it. The direction ratios 2, −1, 2 and −2, 1, −2 describe the same line, pointing opposite ways. Flip one set and the dot product changes sign, so the cosine changes sign too, and you get the supplement of your angle, 180° − θ, instead of θ.
Two crossing lines make two angles that add up to 180°. The modulus makes the cosine non-negative, which always picks the one that is 90° or less.
How do you find the angle between two lines step by step?
Find the angle between the lines (x − 1)/2 = (y + 3)/(−1) = (z − 2)/2 and x/1 = (y − 1)/2 = (z + 4)/(−2).
Read the direction ratios from the denominators. Line 1: 2, −1, 2. Line 2: 1, 2, −2. Check first that each numerator is in the form x − x1 with coefficient 1. A form like (1 − x)/2 flips the sign, as explained in our post on reading direction ratios from a reversed symmetric form.
Multiply and add: (2)(1) + (−1)(2) + (2)(−2) = 2 − 2 − 4 = −4.
Find the lengths: √(4 + 1 + 4) = 3, and √(1 + 4 + 4) = 3.
Apply the formula: cos θ = |−4| / (3 × 3) = 4/9.
So θ = cos⁻¹(4/9), about 63.6°.
Without the modulus you would get cos⁻¹(−4/9), about 116.4°. That is the angle between the two direction arrows, not the one the question asks for. Leave the answer as cos⁻¹(4/9) unless the question asks for degrees.
How do you check if two lines are perpendicular or parallel?
The NCERT chapter gives both tests directly in terms of direction ratios:
Perpendicular (θ = 90°): a1a2 + b1b2 + c1c2 = 0. Example: 1, 2, 3 and 3, 0, −1 give 3 + 0 − 3 = 0, so the lines are perpendicular.
Parallel (θ = 0°): a1/a2 = b1/b2 = c1/c2. Example: 2, −4, 6 and −1, 2, −3 give −2 in every ratio, so the lines are parallel. The minus sign only means they point opposite ways.
Two cautions. If a direction ratio is 0, don't divide by it. Check instead that one set is a multiple of the other, for example 0, 2, 1 and 0, 4, 2. And parallel is not the same as identical. Parallel lines can still be a fixed distance apart, which is a separate calculation covered in our post on the distance between parallel lines in 3D.
What mistakes cost marks on this topic?
Taking the numbers from the numerators. Direction ratios come from the denominators, after you've made every x, y and z coefficient equal to 1. Rewrite (2x − 1)/4 as (x − 1/2)/2 first.
Dropping the modulus. This gives you the obtuse angle, as the example above shows.
Reading the wrong vector. If a line is given in vector form, its direction ratios are the î, ĵ, k̂ coefficients of the vector multiplied by λ, not of the position vector.
If you keep getting a sign wrong and can't see where, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. And if direction cosines themselves feel shaky, the Fermi Concept Library gives each mathematics concept its own lesson, so you can fill that gap before you come back to angles.



