Finding the Equation of a Line

Vector and Cartesian form

A line through the point with position vector a⃗\vec{a}, parallel to the direction vector b⃗\vec{b}, has vector equation r⃗=a⃗+λb⃗\vec{r} = \vec{a} + \lambda\vec{b}. With a⃗=(x1,y1,z1)\vec{a} = (x_1,y_1,z_1) and b⃗=(a,b,c)\vec{b} = (a,b,c), the Cartesian form is:

x−x1a=y−y1b=z−z1c\dfrac{x-x_1}{a} = \dfrac{y-y_1}{b} = \dfrac{z-z_1}{c}

Worked example: through two points

Find the line through (3,−2,−5)(3,-2,-5) and (3,−2,6)(3,-2,6). The direction ratios are (3−3,−2−(−2),6−(−5))=(0,0,11)(3-3, -2-(-2), 6-(-5)) = (0,0,11):

r⃗=(3i^−2j^−5k^)+λ(11k^),x−30=y+20=z+511\vec{r} = (3\hat{i}-2\hat{j}-5\hat{k}) + \lambda(11\hat{k}), \qquad \dfrac{x-3}{0} = \dfrac{y+2}{0} = \dfrac{z+5}{11}

A zero denominator means that coordinate stays fixed: x=3x = 3 and y=−2y = -2 while zz varies, a line parallel to the zz-axis.

Worked example: point and parallel vector

The line through 2i^+3j^+k^2\hat{i}+3\hat{j}+\hat{k} parallel to 4i^−2j^+3k^4\hat{i}-2\hat{j}+3\hat{k} is:

r⃗=(2+4λ)i^+(3−2λ)j^+(1+3λ)k^\vec{r} = (2+4\lambda)\hat{i}+(3-2\lambda)\hat{j}+(1+3\lambda)\hat{k}

At λ=1\lambda = 1 it passes through (6,1,4)(6, 1, 4), a quick way to generate a second point for checking.

Worked example: is a point on the line?

Does (3,−2,10)(3,-2,10) lie on the first line? Its xx and yy match the fixed values 3 and −2, and z+5=15=11λz + 5 = 15 = 11\lambda gives λ=1511\lambda = \dfrac{15}{11}. One value of λ\lambda works for every coordinate, so yes.

Worked example: angle between two lines

Lines with direction ratios (1,2,2)(1,2,2) and (2,−1,2)(2,-1,2) meet at an angle θ\theta with:

cos⁡θ=∣1(2)+2(−1)+2(2)∣1+4+4 4+1+4=49,θ≈63.6∘\cos\theta = \dfrac{|1(2)+2(-1)+2(2)|}{\sqrt{1+4+4}\,\sqrt{4+1+4}} = \dfrac{4}{9}, \qquad \theta \approx 63.6^\circ

Common mistakes

  • Sign slips with negative coordinates. Through (3,−2,−5)(3,-2,-5) the Cartesian form has y+2y+2 and z+5z+5, not y−2y-2 and z−5z-5.
  • Reading a zero denominator as division by zero. It's shorthand for that coordinate being constant.
  • Checking a point with different λ values. A point is on the line only if one λ satisfies every coordinate.
  • Confusing direction ratios and direction cosines. Direction cosines are the ratios divided by the vector's length.

Where this comes up in exams

The 2025-26 CBSE Class XII syllabus lists the Cartesian and vector equation of a line, skew lines, the shortest distance between two lines and the angle between two lines. JEE Main 2026 lists the equation of a line and skew lines in three-dimensional geometry, and JEE Advanced 2026 lists the equation of a straight line in space.

Checked against CBSE Mathematics curriculum, Classes XI-XII (2025-26), JEE (Main) 2026 syllabus (NTA) and JEE (Advanced) 2026 syllabus. Syllabi can change from year to year, so confirm with the latest official notification for your exam.

Continue learning

Once a line has an equation, the shortest distance between two lines and the angle with a plane build on the same direction vector.