- Foundation
- About 18 min
- 5 practice questions
Equation of a line in space
Write the vector equation r = a + λb and the Cartesian equations of a line through a point parallel to a vector (or through two points), and convert between the forms.
If something looks wrong, please tell us.
A line in space is fixed once we know one point on it and its direction, or two points on it. This lesson turns that statement into equations, first in vector form and then in Cartesian (coordinate) form. These equations are the starting point for finding angles and distances in the next two lessons.
Vector equation
Let A be a point with position vector a, and let b be a vector. We want the line l through A parallel to b. Let P be any point on l with position vector r. Then AP is parallel to b, so AP = λb for some real number λ. But AP = r − a. Hence r − a = λb, that is:
Vector equation of the line through the point with position vector a, parallel to b: r = a + λb, where λ is a real parameter.
Conversely, each real value of λ gives the position vector of a point on the line. If b = aî + bĵ + ck̂, then a, b, c are direction ratios of the line (do not confuse the vector b with its magnitude |b|). A line through two points with position vectors a and c has direction c − a, so its equation is r = a + λ(c − a).
Cartesian equations
Let A be (x₁, y₁, z₁), let the direction ratios be a, b, c, and let P be (x, y, z). Writing r = xî + yĵ + zk̂ and comparing the coefficients of î, ĵ, k̂ in r = a + λb gives the parametric equations x = x₁ + λa, y = y₁ + λb, z = z₁ + λc. Eliminating λ:
Cartesian equations: (x − x₁)/a = (y − y₁)/b = (z − z₁)/c. With direction cosines l, m, n: (x − x₁)/l = (y − y₁)/m = (z − z₁)/n.
Converting between the two forms
- Vector form r = a + λb
- Read the point (x₁, y₁, z₁) from a
- Read direction ratios a, b, c from b
- Cartesian form (x − x₁)/a = (y − y₁)/b = (z − z₁)/c
Worked examples
Worked example 1: a point and a direction
Find the vector and Cartesian equations of the line through (2, −1, 3) parallel to î + 2ĵ − 4k̂. Vector: r = (2î − ĵ + 3k̂) + λ(î + 2ĵ − 4k̂). Comparing components, x = 2 + λ, y = −1 + 2λ, z = 3 − 4λ, so the Cartesian form is (x − 2)/1 = (y + 1)/2 = (z − 3)/(−4).
Worked example 2: two points
Find the equations of the line through (1, 2, 3) and (3, −1, 5). Direction ratios: 2, −3, 2. Vector: r = (î + 2ĵ + 3k̂) + λ(2î − 3ĵ + 2k̂). Cartesian: (x − 1)/2 = (y − 2)/(−3) = (z − 3)/2. Check: λ = 1 gives (3, −1, 5), the second point. ✓
Worked example 3: a trap in the Cartesian form
Write the line (x + 3)/2 = (y − 5)/4 = (6 − z)/2 in vector form. The third fraction is not yet in standard form: (6 − z)/2 = (z − 6)/(−2). So the line passes through (−3, 5, 6) with direction ratios 2, 4, −2. Vector form: r = (−3î + 5ĵ + 6k̂) + λ(2î + 4ĵ − 2k̂). Reading the direction ratios as 2, 4, 2 would be a common mistake.
Worked example 4: a point on a line
Does (5, −4, 7) lie on the line of worked example 2? A general point of that line is (1 + 2λ, 2 − 3λ, 3 + 2λ). Setting 1 + 2λ = 5 gives λ = 2; then y = 2 − 6 = −4 and z = 3 + 4 = 7, which match. So yes, it lies on the line (at λ = 2). Where does the line meet the xy-plane (z = 0)? 3 + 2λ = 0 gives λ = −3/2, and the point is (1 − 3, 2 + 9/2, 0) = (−2, 13/2, 0).
Worked example 5: a parallel line
Find the Cartesian equation of the line through (4, 0, −2) parallel to (x − 1)/3 = (y + 2)/(−1) = z/5. Parallel lines have the same direction ratios 3, −1, 5, so the line is (x − 4)/3 = y/(−1) = (z + 2)/5.
Key takeaways
- Vector form: r = a + λb (point a, direction b); through two points: r = a + λ(c − a).
- Parametric form: x = x₁ + λa, y = y₁ + λb, z = z₁ + λc.
- Cartesian form: (x − x₁)/a = (y − y₁)/b = (z − z₁)/c.
- Before reading off a point and direction ratios, make each numerator 'variable minus number'.
- A general point of the line, written with λ, answers questions about points on it.
Check your understanding
-
1. Which is the vector equation of the line through (1, −1, 2) parallel to 3î + ĵ − k̂?
- r = (3î + ĵ − k̂) + λ(î − ĵ + 2k̂)
- r = (î − ĵ + 2k̂) + λ(3î + ĵ − k̂)
- r = (î − ĵ + 2k̂) + (3î + ĵ − k̂)
- r = λ(î − ĵ + 2k̂) + λ(3î + ĵ − k̂)
Show answer
Answer: B. In r = a + λb, a is the position vector of the given point, î − ĵ + 2k̂, and b is the direction 3î + ĵ − k̂. Writing r = (3î + ĵ − k̂) + λ(î − ĵ + 2k̂) swaps the roles of point and direction.
-
2. What is the Cartesian form of r = (2î − ĵ + 4k̂) + λ(î + 3ĵ − 2k̂)?
- (x − 1)/2 = (y − 3)/(−1) = (z + 2)/4
- (x + 2)/1 = (y − 1)/3 = (z + 4)/(−2)
- (x − 2)/1 = (y − 1)/3 = (z − 4)/2
- (x − 2)/1 = (y + 1)/3 = (z − 4)/(−2)
Show answer
Answer: D. The point is (2, −1, 4) and the direction ratios are 1, 3, −2, giving (x − 2)/1 = (y + 1)/3 = (z − 4)/(−2).
-
3. What are direction ratios of the line (x − 1)/2 = (3 − y)/4 = (z + 2)/5?
- 2, −4, 5
- 2, 4, 5
- 1, 3, −2
- −2, 4, −5
Show answer
Answer: A. (3 − y)/4 = (y − 3)/(−4). In standard form the line is (x − 1)/2 = (y − 3)/(−4) = (z + 2)/5, so direction ratios are 2, −4, 5.
-
4. Which point lies on the line (x − 1)/2 = (y + 2)/4 = (z − 3)/(−2)?
- (3, 2, 5)
- (2, 4, −2)
- (3, 2, 1)
- (1, 2, 3)
Show answer
Answer: C. A general point is (1 + 2λ, −2 + 4λ, 3 − 2λ). λ = 1 gives (3, 2, 1). For (3, 2, 5), x and y need λ = 1 but z needs λ = −1, so it is not on the line.
-
5. Assertion (A): The line (x − 4)/5 = (y + 1)/2 = (z − 2)/3 passes through the point (4, −1, 2). Reason (R): The line (x − x₁)/a = (y − y₁)/b = (z − z₁)/c passes through (x₁, y₁, z₁) and has direction ratios a, b, c.
- Both A and R are true, and R is the correct explanation of A
- Both A and R are true, but R is not the correct explanation of A
- A is true, but R is false
- A is false, but R is true
Show answer
Answer: A. Comparing with the standard form, x₁ = 4, y₁ = −1, z₁ = 2. Substituting (4, −1, 2) makes all three fractions 0, so the point is on the line. R is the reason.
Sign in to keep track of the lessons you finish.