• Foundation
  • About 15 min
  • 5 practice questions

Section formula and direction cosines

Find the position vector of a point dividing a segment internally or externally in a given ratio, including the midpoint, and find the direction cosines of a vector and use l² + m² + n² = 1.

If something looks wrong, please tell us.

This last teaching lesson uses position vectors and components to answer two classic questions. Where is the point that divides a segment in a given ratio? And how can the direction of a vector be described by numbers? The answers are the section formula and direction cosines, both of which appear often in coordinate geometry and three-dimensional work.

Section formula: internal division

Let A and B have position vectors a and b, and let R divide AB internally in the ratio m : n, so that AR : RB = m : n with R between A and B. Then n AR = m RB as vectors, that is n(r − a) = m(b − r). Solving, (m + n)r = mb + na, so

Internal division in the ratio m : n: r = (mb + na)/(m + n). External division: r = (mb − na)/(m − n), m ≠ n. Midpoint: r = (a + b)/2.

Notice the cross-over: m, the part next to A, multiplies b, and n multiplies a. Taking m = n = 1 gives the midpoint (a + b)/2. For external division, R lies on line AB extended, with AR : RB = m : n measured outside the segment; the formula changes the plus signs to minus signs.

Worked example 1

A and B have position vectors i + 2j − k and 4i − j + 5k. Find the point dividing AB internally in the ratio 2 : 1. r = (2b + a)/3 = [(8 + 1)i + (−2 + 2)j + (10 − 1)k]/3 = (9i + 0j + 9k)/3 = 3i + 3k. Dividing externally in the ratio 2 : 1 instead gives r = (2b − a)/(2 − 1) = (8 − 1)i + (−2 − 2)j + (10 + 1)k = 7i − 4j + 11k.

Direction cosines

Suppose a vector r = xi + yj + zk makes angles α, β and γ with the positive x-, y- and z-axes, each between 0° and 180°. The numbers l = cos α, m = cos β, n = cos γ are its direction cosines. Looking at the right triangles formed with each axis, cos α = x/|r|, so

For r = xi + yj + zk: l = x/|r|, m = y/|r|, n = z/|r|, and l² + m² + n² = 1.

The unit vector in the direction of r is exactly li + mj + nk, which is why the squares add to 1. Any three numbers proportional to l, m and n, such as the components x, y and z themselves, are called direction ratios. Direction ratios are not unique, but the direction cosines of a given vector are.

Worked example 2

Find the direction cosines of r = 2i − j + 2k. Here |r| = √(4 + 1 + 4) = 3, so l = 2/3, m = −1/3, n = 2/3. Check: 4/9 + 1/9 + 4/9 = 1. The negative value of m means the angle with the y-axis is obtuse.

Worked example 3

A vector makes angles of 60° with the x-axis and 45° with the y-axis (angles in degrees). Find its angle with the z-axis. l = cos 60° = 1/2 and m = cos 45° = 1/√2. Then n² = 1 − 1/4 − 1/2 = 1/4, so n = ±1/2, and γ = 60° or 120°. If the angle is stated to be acute, γ = 60°.

Key takeaways

The point dividing AB internally in the ratio m : n has position vector (mb + na)/(m + n); externally, (mb − na)/(m − n); the midpoint is (a + b)/2. Direction cosines are the cosines of the angles with the axes, equal to the components divided by the magnitude, and their squares add to 1. Dot and cross products, which build on all of this, come in the next course.

Check your understanding

  1. 1. A and B have position vectors 2i + 3j − k and 4i − j + 5k. What is the position vector of the midpoint of AB?

    1. 6i + 2j + 4k
    2. 3i + j + 2k
    3. i − 2j + 3k
    4. 2i + j + 2k
    Show answer

    Answer: B. Midpoint = (a + b)/2 = (6i + 2j + 4k)/2 = 3i + j + 2k.

  2. 2. A and B have position vectors i + j and 4i + 7j. What is the position vector of the point dividing AB internally in the ratio 1 : 2?

    1. 2i + 3j
    2. 3i + 5j
    3. (5/2)i + 4j
    4. 5i + 8j
    Show answer

    Answer: A. r = (1·b + 2·a)/3 = (4i + 7j + 2i + 2j)/3 = (6i + 9j)/3 = 2i + 3j. Using (2b + a)/3 = 3i + 5j swaps the ratio.

  3. 3. What are the direction cosines of i − 2j + 2k?

    1. 1, −2, 2
    2. 1/5, −2/5, 2/5
    3. 1/3, −2/3, 2/3
    4. 1/3, 2/3, 2/3
    Show answer

    Answer: C. |i − 2j + 2k| = √(1 + 4 + 4) = 3, so the direction cosines are 1/3, −2/3, 2/3.

  4. 4. A vector has direction cosines l = 1/2 and m = 1/2, and its third direction cosine n is positive. What is n?

    1. 1/2
    2. 0
    3. 1
    4. 1/√2
    Show answer

    Answer: D. l² + m² + n² = 1 gives n² = 1 − 1/4 − 1/4 = 1/2, so n = 1/√2.

  5. 5. A and B have position vectors i + 2j and 3i + 4j. What is the position vector of the point dividing AB externally in the ratio 2 : 1?

    1. 5i + 6j
    2. (7/3)i + (10/3)j
    3. −i + 0j
    4. (5/3)i + 2j
    Show answer

    Answer: A. r = (2b − a)/(2 − 1) = 6i + 8j − i − 2j = 5i + 6j.

Privacy · Terms · Refunds · Delivery