Lines in Space
A straight line in space is fixed by a point on it and a direction. That direction is measured by direction cosines or direction ratios . This page on lines in space covers how to find them, the angle between two lines, projection of a segment, the symmetric and vector equations of a line, the foot and image of a point, the line of intersection of two planes, and the shortest distance between skew lines. Lines in space are tested every year in JEE Main and JEE Advanced.
- Direction cosines: , , , with
- From direction ratios: (same pattern for and )
- Direction ratios of : , ,
- Angle between lines:
- Perpendicular: ; parallel:
- Projection of on a line:
- Symmetric form: ; vector form:
- Line of intersection of two planes is parallel to
- Skew lines:
- Parallel lines:
1. Direction Cosines of a Line
If , , are the angles which a directed line makes with the positive directions of the x, y and z axes, then , , are called the direction cosines of the line. They are denoted by , , :
If the direction of the line is reversed, the angles become , , and the direction cosines become , , . So an undirected line has two sets of direction cosines that differ only in sign.
| Axis | Angles with x, y, z axes | Direction cosines |
|---|---|---|
| x-axis | ||
| y-axis | ||
| z-axis |
Relation between the direction cosines
Let be any line through the origin with direction cosines , , . Let and . Then
From draw , , perpendicular to the coordinate axes, so that , , and , , .
From the right triangle (Figure 2), , so . In the same way, triangles and give and . Putting these in (1):
- If lies on a line through with direction cosines and , then .
- The point at distance from along a line with direction cosines is .
- is a unit vector parallel to the line.
Since the line makes angles , , with the axes, , , are its direction cosines, so .
In the same way, using , we get .
2. Direction Ratios of a Line
If , , are three numbers proportional to the direction cosines , , of a straight line, then , , are called the direction ratios of the line. They are also called direction numbers or direction components.
By definition, (say), so , , . Then
The same sign, either positive or negative, is taken throughout.
- Direction cosines of a line are unique (apart from reversing the sign), but direction ratios are not: , , is also a set of direction ratios for any .
- If are direction ratios of a line , then is a vector parallel to .
- Parallel lines have the same direction cosines. For a line that does not pass through the origin, draw a parallel line through the origin to find its direction cosines.
.
So the direction cosines are , or, for the opposite direction, .
3. Direction Cosines of the Line Joining Two Points
The direction ratios of the line joining and are , and . Dividing by gives the direction cosines:
Direction ratios of are , or simply .
, so .
Direction cosines are .
From the first relation, ...(1). Putting this in ...(2):
So or .
Case 1: . Then , so .
Direction cosines of one line are .
Case 2: . Then , so .
Direction cosines of the other line are .
4. Angle Between Two Lines
Let be the angle between two lines whose direction cosines are and . Then
If the direction ratios are and , the angle between the lines is given by
For lines that do not meet, the angle is the angle between their directions (Figure 4). For the acute angle, take the modulus of the right-hand side.
Sine of the angle
Conditions for perpendicular and parallel lines
| Lines are | Using direction cosines | Using direction ratios |
|---|---|---|
| Perpendicular () | ||
| Parallel () |
The parallel condition comes from : the sum holds only when , and . Two parallel lines therefore have the same direction cosines.
Therefore the lines are perpendicular.
So , and the acute angle between the lines is .
Take a cube of side with one vertex at and the edges through along the axes: , , , , , , . The four diagonals are , , and .
Direction ratios of are , or , so its direction cosines are .
Direction ratios of are , or , so its direction cosines are .
Similarly, and have direction ratios and .
For and : , so . Any other pair gives as well.
Let be the tetrahedron with at the origin and , , . Let and . We must prove .
Direction ratios of are and of are . Since :
...(1)
Since : ...(2)
Adding (1) and (2), the terms , , cancel and we get
Direction ratios of are and of are . Hence .
5. Projection of a Line Segment on a Line
The projection of the segment joining and on a line whose direction cosines are is
This is , where is the angle between and the line, because the direction cosines of are , , .
Vector form
The projection of on is . Here take and .
- , and are the projections of on , and .
- .
Let and . Since , the direction cosines of the given line are .
Projection of
6. Equation of a Straight Line in Space
Symmetric (Cartesian) form
The equation of the straight line passing through with direction ratios is
The general point on this line is . When the denominators are the direction cosines , the point is and is its actual distance from .
Two-point form
The line passing through and is
Vector form
The line through the point with position vector and parallel to is , where is a scalar. The line through two points with position vectors and is .
Converting between the two forms:
Special lines
| Line | Equation |
|---|---|
| x-axis | |
| y-axis | |
| z-axis | |
| Parallel to the x-axis | |
| Parallel to the y-axis | |
| Parallel to the z-axis | |
| Through the origin |
(a) A line parallel to the z-axis has , , , so , , . The line through is
(b) A line perpendicular to the z-axis has , so and . If it makes angle with the x-axis, then and (the sign is absorbed by the choice of ). The line is
Let and . Then and , so .
Vector form: .
Cartesian form: , that is .
The point lies on the line. Direction ratios are and , so the direction cosines are . Writing the line with direction cosines:
Any point is and . Given , .
For : . For : .
Direction ratios of the line are , , , that is . Its equation is
Any point on the line is . If it lies on the plane,
The point is .
Any point on the first line is and any point on the second line is . The lines intersect if and coincide for some and :
...(1)
...(2)
...(3)
Solving (1) and (2) gives , . These values also satisfy (3): .
So the lines intersect, at .
7. Perpendicular from a Point to a Line: Foot, Length and Image
Using projection
Let be a straight line passing through with direction cosines , and let be a point. If is the foot of the perpendicular from , then
Using the general point of the line
- Write any point of the line as .
- Write the direction ratios of and use line: . Solve for .
- Put back to get the foot . Then is the length of the perpendicular and the line is the perpendicular itself.
- For the image , use the fact that is the midpoint of , so .
Vector form
The foot of the perpendicular from the point with position vector to the line , and the image of that point, are
Direction cosines of the line are , that is .
Perpendicular distance .
Method 1 (general point). Any point on the line is . Direction ratios of are . Since is perpendicular to the line with direction ratios :
So and .
Method 2 (projection). lies on the line and the direction cosines are .
projection of , and .
units, the same as Method 1.
Let . Any point on the given line is , so the direction ratios of are .
Since is perpendicular to the line with direction ratios :
Direction ratios of are , or . The required line is .
Let . Any point on the line is , so the direction ratios of are .
For the foot, line:
So the foot is . Since is the midpoint of and its image :
8. Line of Intersection of Two Planes
A straight line in space can be written as the intersection of two non-parallel planes
This is called the non-symmetric (general) form of the line. To write it in symmetric form we need its direction ratios and one point on it.
Step 1: Direction ratios
The line lies in both planes, so it is perpendicular to both normals: and . By cross-multiplication,
These are the components of
Step 2: A point on the line
If , the line is not parallel to the XY-plane, so it meets it. Put and solve and for and . If this fails, put or instead.
The line is , ...(1). Let be its direction cosines. The line is perpendicular to the normals of both planes:
and
By cross-multiplication, , that is .
So the direction cosines are .
To find a point, put in (1): and . Solving, , . So lies on the line.
The symmetric form is .
Line 1 is perpendicular to the normals and : and . So .
Line 2 is perpendicular to the normals and : and . So .
Hence .
9. Skew Lines and Shortest Distance
Relative position of two lines
Two lines in space are parallel (coplanar and never meeting), intersecting (coplanar and meeting at one point) or skew. Skew lines are lines that are neither parallel nor intersecting, so no plane contains both of them.
Line of shortest distance
For two skew lines, the straight line that is perpendicular to each of them is called the line of shortest distance, and the length it intercepts between the two lines is the shortest distance.
- Write the lines as ...(1) and ...(2).
- Take on (1) and on (2).
- Direction ratios of are .
- Use (1) and (2) to get two equations in and . Solve them to get and ; then is the shortest distance.
Shortest distance formula (Cartesian)
The same formula works with direction ratios in place of direction cosines.
Shortest distance formula (vector)
For and :
- The lines are skew if , that is .
- If this scalar triple product is (equivalently ) and the lines are not parallel, the lines intersect.
- If a line is given in general form, first convert it to symmetric form and then apply the formula.
Distance between parallel lines
For the parallel lines and , , so the skew-lines formula cannot be used. Instead,
Any point on the first line is and on the second line is .
Direction ratios of are .
first line: ...(1)
second line: ...(2)
Solving (1) and (2), and . So and .
Shortest distance units.
Direction ratios of are , or . The line of shortest distance is , or in vector form .
Here , , , , so .
, and .
Shortest distance units.
Here , and .
units.
The first three planes meet at . Take the pair of opposite edges (given by , ) and (given by , ).
In symmetric form, is and is . So the direction ratios are and , and is a point on .
Let the line of shortest distance have direction cosines . It is perpendicular to both edges: and . So , giving , , .
Shortest distance = projection of on this line .
By symmetry, every pair of opposite edges of this tetrahedron is apart.
Common Mistakes to Avoid
- Using direction ratios as direction cosines. Numbers like are direction ratios; direction cosines must satisfy .
- Writing without dividing by the two magnitudes.
- Treating in as a distance when are only direction ratios.
- Reading the point from the equation with the wrong sign: belongs to a line through .
- Calling undefined. A zero denominator simply means all along the line.
- Using the projection formula with direction ratios instead of direction cosines.
- Applying the skew-lines formula to parallel lines, where . Use the parallel-lines formula instead.
- Forgetting to check the third equation when testing whether two lines intersect.
Frequently Asked Questions
What is the difference between direction cosines and direction ratios?
Direction cosines are the cosines of the angles a line makes with the axes, so they satisfy and are unique apart from sign. Direction ratios are any three numbers proportional to them, so a line has infinitely many sets of direction ratios.
Why do direction cosines satisfy ?
For a point at distance from the origin on the line, right triangles with the axes give , and . Substituting in gives , so the sum of squares is .
How do you find the angle between two lines in 3D?
Use with direction cosines, or divide by the product of the magnitudes when you have direction ratios. Take the modulus for the acute angle. The same formula works for skew lines because only the directions matter.
What are skew lines?
Skew lines are two lines in space that are neither parallel nor intersecting. Because they never meet and do not point the same way, no single plane can contain both. They exist only in three dimensions; in a plane, any two non-parallel lines must meet.
How do you find the shortest distance between two skew lines?
Write both lines in vector form and use . If you also need the line of shortest distance, take general points on both lines, make their join perpendicular to both directions and solve for the two parameters.
How do you convert a line from non-symmetric form to symmetric form?
A line given by two plane equations has direction ratios equal to the cross product of the two normals, found by cross-multiplication. For a point, put (or or ) and solve the two plane equations. Then write .
How important are lines in space for JEE Main?
Direction ratios, angle between lines, equation of a line, skew lines and shortest distance are listed explicitly in the JEE Main syllabus, and questions on the foot or image of a point and on intersecting lines are frequent. Most can be solved in under two minutes once the general-point method is automatic.
What should JEE Advanced aspirants practise in this concept?
JEE Advanced combines ideas: lines given as intersections of planes, shortest distance between edges of a solid, conditions for lines to intersect with unknown parameters, and images of a point in a line. Practise converting between Cartesian and vector forms quickly, since multi-correct options often hide the same line in different forms.
Previous year questions on Lines in Space
60 questions from past papers, each with a step-by-step solution.
- JEE Main 2026 Apr 2 Shift 1, Mathematics Q13
- JEE Main 2026 Apr 2 Shift 1, Mathematics Q15
- JEE Main 2026 Apr 2 Shift 2, Mathematics Q15
- JEE Main 2026 Apr 4 Shift 1, Mathematics Q14
- JEE Main 2026 Apr 4 Shift 1, Mathematics Q15
- JEE Main 2026 Apr 4 Shift 2, Mathematics Q14
- JEE Main 2026 Apr 5 Shift 1, Mathematics Q13
- JEE Main 2026 Apr 5 Shift 1, Mathematics Q15
- JEE Main 2026 Apr 5 Shift 2, Mathematics Q14
- JEE Main 2026 Apr 5 Shift 2, Mathematics Q15
Show all 60 questions
- JEE Main 2026 Apr 6 Shift 1, Mathematics Q15
- JEE Main 2026 Apr 6 Shift 1, Mathematics Q16
- JEE Main 2026 Apr 6 Shift 2, Mathematics Q14
- JEE Main 2026 Apr 6 Shift 2, Mathematics Q24
- JEE Main 2026 Apr 8 Shift 2, Mathematics Q15
- JEE Main 2026 Apr 8 Shift 2, Mathematics Q23
- JEE Main 2026 Jan 21 Shift 2, Mathematics Q7
- JEE Main 2026 Jan 21 Shift 2, Mathematics Q8
- JEE Main 2026 Jan 22 Shift 1, Mathematics Q6
- JEE Main 2026 Jan 22 Shift 1, Mathematics Q11
- JEE Main 2026 Jan 22 Shift 2, Mathematics Q10
- JEE Main 2026 Jan 23 Shift 1, Mathematics Q15
- JEE Main 2026 Jan 23 Shift 1, Mathematics Q20
- JEE Main 2026 Jan 23 Shift 2, Mathematics Q22
- JEE Main 2026 Jan 24 Shift 1, Mathematics Q3
- JEE Main 2026 Jan 24 Shift 2, Mathematics Q11
- JEE Main 2026 Jan 28 Shift 1, Mathematics Q18
- JEE Main 2026 Jan 28 Shift 2, Mathematics Q16
- JEE Main 2026 Jan 28 Shift 2, Mathematics Q24
- JEE Advanced 2026 Paper 2, Mathematics Section 2 Q3
- JEE Main 2025 Apr 2 Shift 1, Mathematics Q17
- JEE Main 2025 Apr 2 Shift 2, Mathematics Q1
- JEE Main 2025 Apr 2 Shift 2, Mathematics Q6
- JEE Main 2025 Apr 3 Shift 1, Mathematics Q20
- JEE Main 2025 Apr 3 Shift 2, Mathematics Q2
- JEE Main 2025 Apr 3 Shift 2, Mathematics Q19
- JEE Main 2025 Apr 4 Shift 1, Mathematics Q6
- JEE Main 2025 Apr 4 Shift 2, Mathematics Q19
- JEE Main 2025 Apr 7 Shift 1, Mathematics Q2
- JEE Main 2025 Apr 7 Shift 1, Mathematics Q18
- JEE Main 2025 Apr 7 Shift 2, Mathematics Q14
- JEE Main 2025 Apr 8 Shift 2, Mathematics Q1
- JEE Main 2025 Apr 8 Shift 2, Mathematics Q23
- JEE Main 2025 Jan 22 Shift 1, Mathematics Q8
- JEE Main 2025 Jan 22 Shift 1, Mathematics Q24
- JEE Main 2025 Jan 22 Shift 2, Mathematics Q9
- JEE Main 2025 Jan 23 Shift 1, Mathematics Q9
- JEE Main 2025 Jan 23 Shift 2, Mathematics Q6
- JEE Main 2025 Jan 23 Shift 2, Mathematics Q18
- JEE Main 2025 Jan 24 Shift 1, Mathematics Q18
- JEE Main 2025 Jan 24 Shift 2, Mathematics Q22
- JEE Main 2025 Jan 28 Shift 1, Mathematics Q12
- JEE Main 2025 Jan 28 Shift 2, Mathematics Q8
- JEE Main 2025 Jan 29 Shift 1, Mathematics Q17
- JEE Main 2025 Jan 29 Shift 2, Mathematics Q6
- JEE Main 2025 Jan 29 Shift 2, Mathematics Q13
- JEE Advanced 2025 Paper 1, Mathematics Section 2 Q1
- JEE Advanced 2024 Paper 2, Mathematics Section 2 Q2
- JEE Advanced 2023 Paper 1, Mathematics Section 2 Q2
- JEE Advanced 2022 Paper 1, Mathematics Section 2 Q3
Ready to master Three Dimensional Geometry?
Take a full mock test, practice concept-by-concept, and get an AI-powered rank prediction — all on Fundamenthol.