- Foundation
- About 14 min
- 5 practice questions
Direction cosines of a line through two points
Find the direction ratios and direction cosines of the line joining two given points, and use proportional direction ratios to test whether three points are collinear.
If something looks wrong, please tell us.
Exactly one line passes through two given points. Its direction can be read straight from their coordinates, and this simple fact gives a quick test for whether three points lie on one line. These results are used in every later lesson of the chapter.
The formula
Let P(x₁, y₁, z₁) and Q(x₂, y₂, z₂) be two points, and let the line PQ (directed from P to Q) make angles α, β, γ with the axes. Drop perpendiculars from P and Q to the xy-plane, and from P draw a line parallel to the xy-plane to meet the perpendicular from Q at N. In the right triangle PNQ, NQ = z₂ − z₁ and ∠PQN = γ, so cos γ = (z₂ − z₁)/PQ. In the same way cos α = (x₂ − x₁)/PQ and cos β = (y₂ − y₁)/PQ. Here PQ = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²].
Line through P(x₁, y₁, z₁) and Q(x₂, y₂, z₂): direction ratios x₂ − x₁, y₂ − y₁, z₂ − z₁; direction cosines (x₂ − x₁)/PQ, (y₂ − y₁)/PQ, (z₂ − z₁)/PQ.
The direction ratios are simply the components of the vector PQ. They may equally be taken as x₁ − x₂, y₁ − y₂, z₁ − z₂ (the vector QP), since multiplying all three by −1 gives another set of direction ratios of the same line.
Direction cosines from two points
- Subtract coordinates: x₂ − x₁, y₂ − y₁, z₂ − z₁ (direction ratios)
- Find PQ = √(sum of their squares)
- Divide each direction ratio by PQ
- Check: the squares add to 1
Worked examples
Worked example 1
Find the direction cosines of the line through (1, −2, 3) and (3, 1, −3). Direction ratios: 3 − 1 = 2, 1 − (−2) = 3, −3 − 3 = −6. PQ = √(4 + 9 + 36) = 7. Direction cosines: 2/7, 3/7, −6/7.
Worked example 2: a line through the origin
Find the direction cosines of the line joining the origin to (−2, 1, −2). Direction ratios −2, 1, −2; distance √(4 + 1 + 4) = 3. Direction cosines: −2/3, 1/3, −2/3. These are also the direction cosines of the position vector of the point.
Testing collinearity
Three points A, B, C are collinear if the direction ratios of AB and BC (or AB and AC) are proportional. Proportional direction ratios mean AB ∥ BC, and since the two segments share the point B, they lie on one line.
Worked example 3
Show that A(2, −1, 3), B(4, 3, 1) and C(5, 5, 0) are collinear. Direction ratios of AB: 2, 4, −2. Direction ratios of BC: 1, 2, −1. Since 2, 4, −2 = 2 × (1, 2, −1), they are proportional, AB ∥ BC, and B is common. Hence A, B, C are collinear.
Worked example 4: finding a missing coordinate
Find k if (1, 2, −1), (2, 4, 1) and (4, k, 5) are collinear. Direction ratios of the first join: 1, 2, 2. Of the join of the first and third points: 3, k − 2, 6. For proportionality the ratio must be 3 (from 3/1 and 6/2), so k − 2 = 6 and k = 8.
| Points | Direction ratios | Distance | Direction cosines |
|---|---|---|---|
| (1, −2, 3) to (3, 1, −3) | 2, 3, −6 | 7 | 2/7, 3/7, −6/7 |
| (0, 0, 0) to (−2, 1, −2) | −2, 1, −2 | 3 | −2/3, 1/3, −2/3 |
| (2, −1, 3) to (4, 3, 1) | 2, 4, −2 | 2√6 | 1/√6, 2/√6, −1/√6 |
Key takeaways
- Direction ratios of PQ are the differences of coordinates, x₂ − x₁, y₂ − y₁, z₂ − z₁.
- Divide by the distance PQ to get direction cosines.
- Reversing the order of the points changes all signs, which is allowed for direction ratios.
- Three points are collinear when the joins share a point and have proportional direction ratios.
Check your understanding
-
1. What are the direction cosines of the line from (2, 3, −1) to (4, 4, 1)?
- 2, 1, 2
- 2/5, 1/5, 2/5
- 2/3, 1/3, 2/3
- 1/3, 2/3, 2/3
Show answer
Answer: C. Direction ratios: 2, 1, 2. Distance: √(4 + 1 + 4) = 3. Direction cosines: 2/3, 1/3, 2/3.
-
2. Which are direction ratios of the line through (1, 0, −2) and (3, −1, 4)?
- 2, −1, 6
- 4, −1, 2
- 3, 0, −8
- 2, 1, 2
Show answer
Answer: A. Subtract coordinates: 3 − 1 = 2, −1 − 0 = −1, 4 − (−2) = 6.
-
3. For what value of k are (1, 2, −1), (2, 4, 1) and (4, k, 5) collinear?
- 6
- 8
- 10
- 4
Show answer
Answer: B. Direction ratios of the first join: 1, 2, 2; of the first to the third point: 3, k − 2, 6. Proportionality with ratio 3 gives k − 2 = 6, so k = 8.
-
4. What is the distance between (1, −1, 2) and (3, 1, 3)?
- 9
- √5
- 5
- 3
Show answer
Answer: D. √[(3 − 1)² + (1 + 1)² + (3 − 2)²] = √(4 + 4 + 1) = √9 = 3.
-
5. Assertion (A): Direction ratios of the line joining P(x₁, y₁, z₁) and Q(x₂, y₂, z₂) may be taken as x₁ − x₂, y₁ − y₂, z₁ − z₂. Reason (R): Multiplying every direction ratio of a line by the same non-zero number, such as −1, gives another set of direction ratios of that line.
- 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. x₂ − x₁, y₂ − y₁, z₂ − z₁ are direction ratios of PQ. The set in A is this set multiplied by −1, which by R is again a set of direction ratios of the same line. R explains A.
Sign in to keep track of the lessons you finish.