Direction Ratios, Cosines and Lines in Space: JEE Main
Reviewed Last updated 2026-11-20. Syllabus topic: Direction ratios, direction cosines and lines in space.
In short. Direction cosines are the cosines of the angles a line makes with the axes and satisfy l² + m² + n² = 1; direction ratios are any proportional numbers. The line through a point with ratios a, b, c is (x - x1)/a = (y - y1)/b = (z - z1)/c.
- Direction cosines l, m, n = cos alpha, cos beta, cos gamma, with l² + m² + n² = 1; reversing the direction changes all three signs.
- Direction ratios a, b, c are proportional to l, m, n: l = a/r, m = b/r, n = c/r with r = sqrt(a² + b² + c²).
- The line through points P and Q has direction ratios equal to the coordinate differences of the points.
- Angle between lines: cos(theta) = |a1 a2 + b1 b2 + c1 c2|/(r1 r2); perpendicular means the dot product is zero, parallel means proportional ratios.
Syllabus line: THREE DIMENSIONAL GEOMETRY : Coordinates of a point in space, the distance between two points, section formula, direction ratios and direction cosines and the angle between two intersecting lines. Equation of a line; Skew lines, the shortest distance between them and its equation. (NTA JEE (Main) 2026 syllabus, Mathematics, Unit 11 (https://jeemain.nta.nic.in/document/syllabus-2026/))
Before you start
Prerequisites
- Points in space, distance and section formula: Direction ratios of a line through two points are coordinate differences. Read this first if the distance formula in space is not automatic.
- Scalar and vector products: The angle formula is the dot product of direction vectors.
- Trigonometric functions and identities: Direction cosines use cosines of angles such as 60 degrees and 45 degrees.
Related topics
The concept step by step
Direction cosines of a line
Direct a line, and let it make angles alpha, beta and gamma with the positive x, y and z axes. The numbers l = cos alpha, m = cos beta and n = cos gamma are its direction cosines. For a unit vector along the line these are exactly its three components, so l² + m² + n² = 1. The opposite direction has direction cosines -l, -m, -n. The x-axis has direction cosines (1, 0, 0), the y-axis (0, 1, 0) and the z-axis (0, 0, 1).
Direction ratios and how to normalise them
Any three numbers a, b, c proportional to l, m, n are direction ratios of the line. They are not unique: (2, 3, 6) and (4, 6, 12) describe the same line. To get the direction cosines divide by the magnitude r = sqrt(a² + b² + c²): l = a/r, m = b/r, n = c/r, with the sign choice of r giving the two opposite directions. For the line through P(x1, y1, z1) and Q(x2, y2, z2) the direction ratios are (x2 - x1, y2 - y1, z2 - z1).
Equation of a line
The line through A(x1, y1, z1) with direction ratios a, b, c consists of the points (x1 + a t, y1 + b t, z1 + c t) for real t. Eliminating t gives the symmetric form (x - x1)/a = (y - y1)/b = (z - z1)/c. If a ratio is zero, say c = 0, the line is written (x - x1)/a = (y - y1)/b, z = z1: the zero ratio means that coordinate stays constant. The line through two points uses their coordinate differences as ratios. To read a line, rewrite each fraction so that x, y and z have coefficient one.
Angle between two lines
The angle between two lines is the angle between their direction vectors, taken in [0, 90 degrees]. For direction ratios (a1, b1, c1) and (a2, b2, c2): cos(theta) = |a1 a2 + b1 b2 + c1 c2|/(sqrt(a1² + b1² + c1²) sqrt(a2² + b2² + c2²)). With direction cosines the denominator is 1. Perpendicular lines satisfy a1 a2 + b1 b2 + c1 c2 = 0, and parallel lines have proportional ratios. The modulus gives the acute angle; without it the formula gives the angle between the two directions, which may be obtuse.
Points on a line and perpendicular foot
A point on the line at distance d from the base point A along the direction (l, m, n) is A + d (l, m, n). The foot of the perpendicular from an outside point P to the line through A with direction (a, b, c) is found by choosing t so that the vector from the line point to P is perpendicular to the direction: t = ((P - A) . d)/(d . d). The perpendicular distance is then the distance from P to that foot. These two moves, parametrise and impose a dot product of zero, solve most line problems.
Worked examples
Each solution shows the marks every step would earn. The sanity check tests units and size of the answer.
Example 1 (easy)
Find the direction cosine l of the line through P(1, -1, 2) and Q(3, 1, 3), taking the direction from P to Q.
| Step | Marks |
|---|---|
| Direction ratios: (3 - 1, 1 + 1, 3 - 2) = (2, 2, 1). | 1 |
| Magnitude r = sqrt(4 + 4 + 1) = 3. | 1 |
| l = 2/3 = 0.667. | 1 |
| Total: 3 marks | 3 |
Answer: l = 2/3 (direction cosines 2/3, 2/3, 1/3)
Fast method: (2, 2, 1) is a standard triple with magnitude 3.
Sanity check: A direction cosine lies between -1 and 1. Check the identity: (2/3)² + (2/3)² + (1/3)² = 9/9 = 1.
Example 2 (easy)
A line is equally inclined to the three coordinate axes. Find the angle it makes with each axis, in degrees (acute).
| Step | Marks |
|---|---|
| Equal angles give l = m = n. | 1 |
| 3 l² = 1, so l = 1/sqrt(3) for the acute angle. | 1 |
| cos(alpha) = 0.5774, so alpha = 54.74 degrees. | 1 |
| Total: 3 marks | 3 |
Answer: about 54.74 degrees
Fast method: Direction ratios (1, 1, 1); divide by sqrt(3); the angle is arccos(1/sqrt(3)).
Sanity check: Limiting case: if one cosine were 1 the angle would be 0; here each cosine is 0.577, so each angle lies between 45 and 60 degrees, in line with 54.74 degrees.
Example 3 (medium)
Find the acute angle, in degrees, between the lines (x - 2)/1 = (y + 1)/1 = (z - 3)/0 and x/0 = (y - 4)/1 = (z + 2)/1.
| Step | Marks |
|---|---|
| Direction ratios: (1, 1, 0) and (0, 1, 1), each with magnitude sqrt(2). | 1 |
| Dot product = 0 + 1 + 0 = 1. | 1 |
| cos(theta) = 1/(sqrt(2) sqrt(2)) = 1/2. | 1 |
| theta = 60 degrees. | 1 |
| Total: 4 marks | 4 |
Answer: 60 degrees
Fast method: Each direction has two unit entries and one zero, with one overlap, so the dot product is 1 against 2: cos = 1/2.
Sanity check: The cosine is positive and below 1, so the angle is acute; cos 60 degrees = 0.5 matches.
Example 4 (medium)
A line passes through A(1, 2, 3) and B(4, 6, 15). A point P lies on the ray AB at a distance of 26 units from A. Find x + y + z for P.
| Step | Marks |
|---|---|
| Direction ratios AB = (3, 4, 12), magnitude 13, so direction cosines (3/13, 4/13, 12/13). | 2 |
| P = A + 26 (3/13, 4/13, 12/13) = (1 + 6, 2 + 8, 3 + 24). | 1 |
| P = (7, 10, 27), so x + y + z = 44. | 1 |
| Total: 4 marks | 4 |
Answer: 44 (P = (7, 10, 27))
Fast method: 26 is twice 13, so go twice the vector AB from A: A + 2 (3, 4, 12).
Sanity check: Distance AP = sqrt(36 + 64 + 576) = sqrt(676) = 26, which matches the required distance and the direction is the same as AB.
Example 5 (medium)
The line (2x - 4)/6 = (1 - y)/2 = (z + 3)/3 is perpendicular to a line with direction ratios 1, 2, k. Find k.
| Step | Marks |
|---|---|
| Rewrite: (x - 2)/3 = (y - 1)/(-2) = (z + 3)/3, so the direction ratios are (3, -2, 3). | 2 |
| Perpendicular: 3(1) + (-2)(2) + 3 k = 0. | 1 |
| 3 - 4 + 3 k = 0, so k = 1/3 = 0.333. | 1 |
| Total: 4 marks | 4 |
Answer: k = 1/3
Fast method: Normalise the line first (divide the first fraction by 2 and flip the y fraction), then set the dot product to zero.
Sanity check: Substitute back: (3, -2, 3) . (1, 2, 1/3) = 3 - 4 + 1 = 0. The trap value (6, 2, 3) would give k = -10/3, and (6, 2, 3) . (1, 2, -10/3) = 6 + 4 - 10 = 0 too, which shows why the wrong reading is consistent but wrong.
Example 6 (hard, multi-step)
Find the perpendicular distance, in units, of the point P(4, 5, 3) from the line (x - 1)/2 = (y - 2)/1 = (z - 3)/2, and the sum of the coordinates of the foot of the perpendicular.
| Step | Marks |
|---|---|
| A general point on the line is F = (1 + 2t, 2 + t, 3 + 2t); direction d = (2, 1, 2). | 1 |
| PF = (2t - 3, t - 3, 2t) must satisfy PF . d = 0: 2(2t - 3) + (t - 3) + 2(2t) = 9t - 9 = 0, so t = 1. | 2 |
| F = (3, 3, 5), with coordinate sum 11. | 1 |
| PF = (-1, -2, 2), so the distance = sqrt(1 + 4 + 4) = 3 units; foot sum 11. | 1 |
| Total: 5 marks | 5 |
Answer: perpendicular distance 3 units; foot (3, 3, 5), coordinate sum 11
Fast method: t = ((P - A) . d)/(d . d) = ((3, 3, 0) . (2, 1, 2))/9 = 1 directly; then F and the length.
Sanity check: The distance 3 must be at most the distance from P to the base point A(1, 2, 3), which is sqrt(9 + 9 + 0) = 4.24; and 3 < 4.24, as it should be for a perpendicular distance.
Example 7 (hard)
A line has direction ratios (2, 3, 6). Find sin² alpha + sin² beta + sin² gamma for the angles it makes with the axes.
| Step | Marks |
|---|---|
| Direction cosines: (2/7, 3/7, 6/7). | 1 |
| sin² alpha + sin² beta + sin² gamma = 3 - (cos² alpha + cos² beta + cos² gamma). | 1 |
| The cosine squares sum to 4/49 + 9/49 + 36/49 = 1. | 1 |
| The required sum is 3 - 1 = 2. | 1 |
| Total: 4 marks | 4 |
Answer: 2
Fast method: The result is 2 for every line, so no calculation is needed once l² + m² + n² = 1 is recalled.
Sanity check: Limiting case: for the x-axis, alpha = 0, beta = gamma = 90 degrees: 0 + 1 + 1 = 2.
Formulas and units
| Result | Formula | Valid when | Units or note | Worked example |
|---|---|---|---|---|
| Direction cosines | l = cos alpha, m = cos beta, n = cos gamma; l² + m² + n² = 1 | direction cosines of any directed line in space | dimensionless | Example 2 |
| Ratios to cosines | l = a/r, m = b/r, n = c/r, r = sqrt(a² + b² + c²) | a, b, c not all zero, direction ratios of the line | dimensionless | Example 1 |
| Ratios of the line PQ | (x2 - x1, y2 - y1, z2 - z1) | any two distinct points P and Q | length | Example 1 |
| Line through A with ratios a, b, c | (x - x1)/a = (y - y1)/b = (z - z1)/c | a, b, c not all zero; a zero ratio means that coordinate is constant | n/a (coordinates) | Example 5 |
| Angle between two lines | cos(theta) = |a1 a2 + b1 b2 + c1 c2|/(r1 r2) | a, b, c are direction ratios; gives the acute angle | dimensionless | Example 3 |
| Perpendicular lines | a1 a2 + b1 b2 + c1 c2 = 0 | direction ratios of two lines in space | dimensionless | Example 5 |
| Parallel lines | a1/a2 = b1/b2 = c1/c2 | ratios proportional; a zero ratio matches a zero ratio | dimensionless | none |
| Sine identity for the axes | sin² alpha + sin² beta + sin² gamma = 2 | direction angles alpha, beta, gamma of one line with the axes | dimensionless | Example 7 |
| Foot of perpendicular parameter | t = ((P - A) . d)/(d . d) | A on the line, d its direction; F is the foot from P | dimensionless | Example 6 |
Common mistakes and speed
- Reading direction ratios from the numerators or denominators of a line not in standard form. Why it tempts: The pattern 'numbers under the fractions' works for the standard form, so the coefficient 2 in 2x - 4 or the minus sign in 1 - y is overlooked, and the resulting wrong answer is self-consistent.
- Forgetting the modulus when the question asks for the acute angle. Why it tempts: The raw dot-product cosine is negative for two direction vectors that point partly opposite; the option with the minus sign looks like a finished answer.
- Using direction ratios as direction cosines without dividing by the magnitude. Why it tempts: Both are triples describing the same direction, so the unit-length condition l² + m² + n² = 1 is forgotten.
- Taking the angle with the z-axis from sin or cos of the wrong given angle, or ignoring the acute or obtuse condition. Why it tempts: cos² gamma = 1/4 has two solutions; the stem's word 'acute' is the only thing that picks n = +1/2.
- Treating a zero direction ratio as an undefined line. Why it tempts: A zero in a denominator looks illegal; it is symbolic and means that the numerator is zero, that is the coordinate is constant.
Time per question and fast method
Target: about 75 seconds per question.
Read the ratios after making every coefficient of x, y and z equal to one. For angle questions use the dot product over the product of magnitudes and keep a standard triple in mind (1, 2, 2) with 3, (2, 3, 6) with 7. For a perpendicular foot write the point as A + t d and solve one linear equation for t.
Recall quiz
Pick an option for each question. Your answers stay on this page and are not sent anywhere.
Score: 0 of 5 correct. Pick an option for each question.
Practice
- A line has direction ratios 2, 3, 6. If l, m, n are its direction cosines with all of them positive, the… Verified (T1)
- The lines L1: (x - 1)/1 = (y + 2)/2 = (z - 3)/2 and L2: x/2 = (y - 1)/(-3) = (z + 4)/(-6) make an acute angle… Verified (T1)
- The line through the points (1, 2, -1) and (3, -2, 3) meets the xy-plane (z = 0) at the point (a, b, 0). The… Verified (T1)
- A line makes angles of 60 degrees and 45 degrees with the positive x-axis and positive y-axis, and an acute… Verified (T1)
- Two lines have direction cosines l, m, n satisfying l + m + n = 0 and m² + l m - 2 l² = 0. If theta is the… Verified (T3)
Previous-year questions
Previous-year questions are not imported yet. Previous-year questions are not imported yet; see the official papers on the NTA site. Official NTA papers page.
Going deeper and revision
Direction cosines: identities and angles with the axes
For any line l² + m² + n² = 1, hence cos² alpha + cos² beta + cos² gamma = 1 and sin² alpha + sin² beta + sin² gamma = 2. A line equally inclined to the three axes has l = m = n = +-1/sqrt(3), so the angle with each axis is arccos(1/sqrt(3)) = 54.74 degrees (or 125.26 degrees for the reverse direction). A line in the xy-plane has n = 0. A line makes at most two independent angles with the axes: given alpha and beta the third satisfies cos² gamma = 1 - cos² alpha - cos² beta, which has two values of gamma, an acute and an obtuse one. Use the stated condition (acute, positive) to choose.
Direction ratios: construction and non-uniqueness
Direction ratios of PQ are the differences of coordinates, in either order, because only proportions matter. If a, b, c are direction ratios then so are k a, k b, k c for any k other than zero. To compare two lines reduce them to the smallest integers or divide by the magnitude. Be careful with non-standard forms: (2x - 4)/6 = (1 - y)/2 = (z + 3)/3 must first be rewritten as (x - 2)/3 = (y - 1)/(-2) = (z + 3)/3 so the ratios are (3, -2, 3), not (6, 2, 3). The ratios are read from the coefficients of x, y and z after each is made one. Skipping this rewrite is a frequent source of wrong answers in this topic.
Equations of a line and where it meets a coordinate plane
Vector form: r = a + t d. Symmetric form: (x - x1)/a = (y - y1)/b = (z - z1)/c. Two-point form: (x - x1)/(x2 - x1) = (y - y1)/(y2 - y1) = (z - z1)/(z2 - z1). The line meets the xy-plane where z = 0, which fixes the parameter t = -z1/c and then x and y. A line parallel to a coordinate plane has one zero ratio; a line parallel to an axis has two zero ratios, for example (0, 0, 5), whose direction cosines are (0, 0, 1). A line through the origin with direction cosines l, m, n passes through (l d, m d, n d), at distance d from the origin.
Angle between lines: tests, conditions and examiner favourites
Parallel: a1/a2 = b1/b2 = c1/c2. Perpendicular: a1 a2 + b1 b2 + c1 c2 = 0. Acute angle: use the modulus. Typical questions: find the angle between two given lines; find an unknown ratio so that two lines are perpendicular or parallel; given two relations on l, m, n (one linear, one quadratic) find the angle between the two lines they define, by eliminating one variable and factorising; find the foot of the perpendicular from a point to a line and the perpendicular distance; find a point on the line at a given distance from a point. Check that the angle between (1, 1, 0) and (0, 1, 1) is 60 degrees, a pair that appears often. The sine form sin(theta) = |d1 x d2|/(|d1||d2|) gives the same angle.
Memory hook
Suppose a kite is flying at the end of a straight string held by a child at the corner of a field. The child measures how far the string goes east, how far north and how high.
- The string goes 3 m east, 4 m north and 12 m up in a short stretch, so the numbers (3, 4, 12) tell the direction; ten times as much string in the same direction has ratios (30, 40, 120).
- To describe the direction as a pure direction, divide by the stretch length 13 m: the direction cosines are (3/13, 4/13, 12/13), whose squares add to 1.
- A second string with ratios (12, 0, -3) makes with this one a dot product of 36 + 0 - 36 = 0, so the two strings are at right angles.
A line's direction is described by any proportional triple, direction cosines are that triple scaled to unit length, and a zero dot product means perpendicular lines.
Direction ratios say which way, direction cosines say which way with the length scaled to one.
Revision card
Try to answer each without looking above.
- State the identity satisfied by direction cosines and the direction cosines of the three axes.
- How do you convert direction ratios into direction cosines?
- Write the symmetric equation of the line through a point with given ratios, and say what a zero ratio means.
- Write the angle formula between two lines, and the conditions for parallel and perpendicular lines.
- How do you read direction ratios from a line given in a non-standard form?
- Outline how to find the foot of the perpendicular from a point to a line.
Sources and review
Reviewed Reviewed on 2026-11-20: every number recomputed by code and independently reviewed; textbook section references pending.
- Method: Every number in worked examples, recall checks and notes recomputed by code; claims recomputed independently by a separate verifier run using other numerical methods; textbook section references not yet attached; wording defects found were fixed afterwards and re-linted (code checks re-run) but not re-reviewed by a second run; syllabus scope compared with the NTA JEE Main 2026 syllabus text (by the verifier; see the report)
- Reviewer: independent verifier agent run (not the author)
- Date: 2026-11-20
- Defects found: 4; fixed: 4
- Report: content/reviews/learn7-tdg-2026-11-20.md
Textbook references
- NCERT Mathematics Part 2, Class 12 (reprint 2026-27), Chapter 11: Three Dimensional Geometry, 11.2 Direction Cosines and Direction Ratios of a Line (read from the page image, PDF page 2) (read 2026-11-22)
- NCERT Mathematics Part 2, Class 12 (reprint 2026-27), Chapter 11: Three Dimensional Geometry, 11.2 Direction Cosines and Direction Ratios of a Line (read from the page image, PDF page 3) (read 2026-11-22)
- NCERT Mathematics Part 2, Class 12 (reprint 2026-27), Chapter 11: Three Dimensional Geometry, 11.2.1 Direction cosines of a line passing through two points (read from the page image, PDF page 4) (read 2026-11-22)
- NCERT Mathematics Part 2, Class 12 (reprint 2026-27), Chapter 11: Three Dimensional Geometry, 11.3.1 Equation of a line through a given point and parallel to a given vector b (read from the page image, PDF page 6) (read 2026-11-22)
- NCERT Mathematics Part 2, Class 12 (reprint 2026-27), Chapter 11: Three Dimensional Geometry, 11.4 Angle between Two Lines (read from the page image, PDF page 7) (read 2026-11-22)
- NCERT Mathematics Part 2, Class 12 (reprint 2026-27), Chapter 11: Three Dimensional Geometry, 11.4 Angle between Two Lines (read from the page image, PDF page 8) (read 2026-11-22)
Sources used
- Syllabus: NTA JEE (Main) 2026 syllabus, Mathematics, Unit 11 (https://jeemain.nta.nic.in/document/syllabus-2026/), imported into syllabus/lines/jee-main/2026.json
- Standard results of analytic geometry in three dimensions (direction cosines, angle between lines); no textbook section reference attached yet (to be sourced at verification). Content written fresh for this site.
How labels work: see how answers and lessons are verified. Found a mistake? Use Report an error on any question page.