Class 12 Maths, Worked in Full Past papersGet updates
Chapter 11 · Three Dimensional Geometry

Example 3: Direction cosines of the line through (−2,4,−5)(-2, 4, -5) and (1,2,3)(1, 2, 3)

ExamplesDirection cosines of a line through two points · Section 11.2.1
The question

Find the direction cosines of the line passing through the two points (−2,4,−5)(-2, 4, -5) and (1,2,3)(1, 2, 3)⁠.

Exam answer

Let P(−2,4,−5)P(-2, 4, -5) and Q(1,2,3)Q(1, 2, 3)⁠. Direction ratios of PQPQ⁠:

1−(−2), 2−4, 3−(−5)=3, −2, 8\begin{aligned} &1 - (-2),\ 2 - 4,\ 3 - (-5) \\ &= 3,\ -2,\ 8 \end{aligned} PQ=32+(−2)2+82=9+4+64=77\begin{aligned} PQ &= \sqrt{3^2 + (-2)^2 + 8^2} \\ &= \sqrt{9 + 4 + 64} = \sqrt{77} \end{aligned}

Direction cosines are x2−x1PQ,y2−y1PQ,z2−z1PQ\frac{x_2 - x_1}{PQ}, \frac{y_2 - y_1}{PQ}, \frac{z_2 - z_1}{PQ}⁠.

∴\therefore The direction cosines are 377,−277,877\dfrac{3}{\sqrt{77}}, \dfrac{-2}{\sqrt{77}}, \dfrac{8}{\sqrt{77}}⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Going from PP to QQ means moving x2−x1x_2 - x_1⁠, y2−y1y_2 - y_1 and z2−z1z_2 - z_1 along the three axes. These three differences are direction ratios of the line. Dividing each by the length PQPQ turns them into the direction cosines.

Given, to find, and the plan
Given
Two points of the line: P(−2,4,−5)P(-2, 4, -5) and Q(1,2,3)Q(1, 2, 3)⁠.
To find
The direction cosines of the line PQPQ⁠.
Plan
(1) Name the points. (2) Subtract to get direction ratios. (3) Find PQPQ by the distance formula. (4) Divide. (5) Check, and look at the other direction.

Basics you need

1Direction cosines of the line through two points

For P(x1,y1,z1)P(x_1, y_1, z_1) and Q(x2,y2,z2)Q(x_2, y_2, z_2)⁠, the direction cosines of PQPQ are x2−x1PQ,y2−y1PQ,z2−z1PQ\frac{x_2 - x_1}{PQ}, \frac{y_2 - y_1}{PQ}, \frac{z_2 - z_1}{PQ} (Section 11.2.1). Lesson: direction cosines and direction ratios

2Distance between two points

PQ=(x2−x1)2+(y2−y1)2+(z2−z1)2PQ = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}⁠: Pythagoras across the floor, then up. Basics: distance in 3D

3Points in space

Each point has three coordinates, one for each axis; a negative coordinate is on the negative side of that axis. Basics: three numbers fix a point

4The check

Direction cosines always satisfy l2+m2+n2=1l^2 + m^2 + n^2 = 1⁠. Basics: direction cosines

Solution

  1. Name the points

    Take P(x1,y1,z1)=(−2,4,−5)P(x_1, y_1, z_1) = (-2, 4, -5) and Q(x2,y2,z2)=(1,2,3)Q(x_2, y_2, z_2) = (1, 2, 3)⁠.

    The formula is written for a first point PP and a second point QQ⁠; the order decides the direction (from PP towards QQ⁠). The book makes the same choice.
    Coordinates of a point in space. Basics: three numbers fix a point
  2. Subtract: the direction ratios

    x2−x1=1−(−2)=3,y2−y1=2−4=−2,z2−z1=3−(−5)=8.\begin{aligned} x_2 - x_1 &= 1 - (-2) = 3, \\ y_2 - y_1 &= 2 - 4 = -2, \\ z_2 - z_1 &= 3 - (-5) = 8. \end{aligned}
    X Y Z P(−2, 4, −5) Q(1, 2, 3) x: +3 y: −2 z: +8 O
    Oblique projection, not to scale. From PP to QQ in three moves parallel to the axes (dashed): 3 in xx⁠, then −2-2 in yy⁠, then 8 in zz⁠. These moves are the direction ratios 3,−2,83, -2, 8 of PQPQ⁠.
    Subtracting a negative number adds it: 1−(−2)=31 - (-2) = 3 and 3−(−5)=83 - (-5) = 8⁠. The three differences are how far you move along each axis from PP to QQ⁠, so they point along the line: they are direction ratios of PQPQ (the Note in Section 11.2.1).
    Direction ratios of PQPQ⁠: x2−x1,y2−y1,z2−z1x_2 - x_1, y_2 - y_1, z_2 - z_1⁠. Lesson: Examples 1–5
  3. Find the length PQPQ

    PQ=32+(−2)2+82=9+4+64=77.\begin{aligned} PQ &= \sqrt{3^2 + (-2)^2 + 8^2} \\ &= \sqrt{9 + 4 + 64} = \sqrt{77}. \end{aligned}
    The distance formula squares the three differences just found, so (−2)2=4(-2)^2 = 4 is positive. 77 is 7×117 \times 11⁠, which has no square factor, so 77\sqrt{77} does not simplify.
    Distance formula in space. Basics: Pythagoras twice
  4. Divide by PQPQ

    l=377,m=−277,n=877.l = \frac{3}{\sqrt{77}}, \quad m = \frac{-2}{\sqrt{77}}, \quad n = \frac{8}{\sqrt{77}}.
    In the book's Fig 11.2, the right triangle PNQPNQ has hypotenuse PQPQ and the side NQ=z2−z1NQ = z_2 - z_1 next to the angle γ\gamma⁠, so cos⁡γ=z2−z1PQ\cos\gamma = \frac{z_2 - z_1}{PQ}⁠. The same argument with the other two axes gives cos⁡α\cos\alpha and cos⁡β\cos\beta⁠. In other words, dividing the direction ratios by PQPQ makes the squares add up to 1.
    Section 11.2.1: cos⁡α=x2−x1PQ\cos\alpha = \frac{x_2 - x_1}{PQ}⁠, and so on. Lesson: direction cosines
  5. Check, and the other direction

    977+477+6477=7777=1.\frac{9}{77} + \frac{4}{77} + \frac{64}{77} = \frac{77}{77} = 1.

    Taking the line from QQ to PP instead gives −377,277,−877\frac{-3}{\sqrt{77}}, \frac{2}{\sqrt{77}}, \frac{-8}{\sqrt{77}}⁠.

    The squares adding up to 1 confirms that these are direction cosines. Swapping the two points reverses every difference, which is the same line in the opposite direction (Note in Section 11.2.1: either set of differences may be used). The book gives the direction from the first point to the second. If you prefer rationalised denominators, 377=37777\frac{3}{\sqrt{77}} = \frac{3\sqrt{77}}{77}⁠, and so on.
    l2+m2+n2=1l^2 + m^2 + n^2 = 1⁠. Basics: direction cosines
Result

The direction cosines of the line through (−2,4,−5)(-2, 4, -5) and (1,2,3)(1, 2, 3) are 377,−277,877\frac{3}{\sqrt{77}}, \frac{-2}{\sqrt{77}}, \frac{8}{\sqrt{77}} (or all three with the opposite sign, for the opposite direction).

(Textbook answer: 377,−277,877\frac{3}{\sqrt{77}}, \frac{-2}{\sqrt{77}}, \frac{8}{\sqrt{77}}⁠.)

Check it with numbers

77≈8.774964\sqrt{77} \approx 8.774964⁠, so l≈0.341882l \approx 0.341882⁠, m≈−0.227921m \approx -0.227921⁠, n≈0.911685n \approx 0.911685⁠. The angles with the axes are about 70.01∘70.01^\circ⁠, 103.17∘103.17^\circ and 24.26∘24.26^\circ⁠.

Walking from PP by 77\sqrt{77} times the direction cosines lands on QQ⁠: (−2+3, 4−2, −5+8)=(1,2,3)(-2 + 3,\ 4 - 2,\ -5 + 8) = (1, 2, 3)⁠.

Common mistakes
  1. Sign slips with negative coordinates. 1−(−2)=31 - (-2) = 3⁠, not −1-1⁠; 3−(−5)=83 - (-5) = 8⁠, not −2-2⁠.
  2. Subtracting in mixed order, for example x2−x1x_2 - x_1 but y1−y2y_1 - y_2⁠. All three differences must be "second minus first", or all "first minus second".
  3. Giving the direction ratios as the answer. 3,−2,83, -2, 8 are direction ratios; the direction cosines are these divided by 77\sqrt{77}⁠.
What to take away
  1. Two points give direction ratios by subtraction, in the same order for all three coordinates.
  2. Divide by the distance between the points to get the direction cosines.
  3. Swapping the points flips all three signs: the same line, the other way.

Every fact used, and where it comes from

FactUsed inSource
Direction ratios of PQPQ⁠: x2−x1,y2−y1,z2−z1x_2 - x_1, y_2 - y_1, z_2 - z_1 (or the negatives)Steps 2, 5Note in Section 11.2.1 (Lesson)
Distance formula PQ=(x2−x1)2+(y2−y1)2+(z2−z1)2PQ = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}Step 3Section 11.2.1 (Basics)
Direction cosines x2−x1PQ,y2−y1PQ,z2−z1PQ\frac{x_2 - x_1}{PQ}, \frac{y_2 - y_1}{PQ}, \frac{z_2 - z_1}{PQ}⁠, from Fig 11.2Step 4Section 11.2.1 (Lesson)
l2+m2+n2=1l^2 + m^2 + n^2 = 1Step 5Section 11.2 (Basics)
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →