Loading

Formulas · Mathematics

Three-dimensional geometry

5 formulas, each with worked examples. Revision sheet · Practise these formulas

Class 11

Distance between two points in space

What each letter means
the distance between the points P(x₁, y₁, z₁) and Q(x₂, y₂, z₂)
the x-coordinate of P
the y-coordinate of P
the z-coordinate of P
the x-coordinate of Q
the y-coordinate of Q
the z-coordinate of Q

The distance between two points in space is the square root of the sum of the squares of the differences of their three coordinates.

Why it works

Go from P to Q in two moves: first across the floor (the x and y differences), which is √((x₂ − x₁)² + (y₂ − y₁)²) long by the flat distance formula, then straight up by z₂ − z₁. The two moves are at right angles, so by Pythagoras their squares add once more.

When to use it

Lengths of segments in space, the diagonal of a box, and testing whether points lie on one line or make a given triangle.

How to use it

  1. Take away the coordinates of P from those of Q, one pair at a time.
  2. Square the three differences and add them.
  3. Take the square root.

To remember: The flat distance formula with one more square under the root.

Other forms

  • Special caseWhen P is the origin, and Q is (x, y, z).

Worked examples

Story

A drone rises from (0, 0, 0) to (6, 2, 3), in metres. How far is it from where it started?

Answer: 7

Picture

Find the length of the long diagonal of a box 3 cm by 4 cm by 12 cm.

Answer: 13

Direct

Find the distance between (1, −3, 4) and (−4, 1, 2).

Answer: 6.708203932499369

Reverse

The point (3, 4, z), with z positive, is 13 units from the origin. Find z.

Try it first, then show the working

Answer: 12

Exam

Show that (−2, 3, 5), (1, 2, 3) and (7, 0, −1) lie on one line.

Try it first, then show the working
  1. AB = √14, BC = √56 = 2√14 and AC = √126 = 3√14.
  2. AB + BC = AC, so the three points lie on one line.

Answer: AB + BC = AC, so they are collinear

Common mistake: Forgetting the z term, or squaring before taking away (x₂² − x₁² is not (x₂ − x₁)²).

Class 11

Section formula in space

What each letter means
the point that divides AB in the ratio m1 : m2 (AP : PB = m1 : m2)
the first part of the ratio (the share next to A)
the second part of the ratio (the share next to B)
the x-coordinate of A
the y-coordinate of A
the z-coordinate of A
the x-coordinate of B
the y-coordinate of B
the z-coordinate of B

The point that splits AB in the ratio m1 : m2 is found one coordinate at a time, with the same weighted average as on a flat page, now for z as well.

Why it works

Drop perpendiculars from A, P and B onto a coordinate plane: their feet divide the shadow of AB in the same ratio, so the flat section formula gives the x and y. Doing the same on another plane gives z.

When to use it

Finding the point a given fraction of the way along a segment in space, the midpoint, and the ratio in which a plane or a point divides a segment.

How to use it

  1. Weight each end by the part of the ratio on the far side: m1 goes with B, m2 with A.
  2. Do this for x, for y and for z, dividing each by m1 + m2.

To remember: Cross the ratio over: m1 with the far end.

Other forms

  • Special caseWhen m1 = m2: the midpoint.

Worked examples

Story

A cable runs straight from the top of a pole at (0, 0, 12) to a peg at (9, 12, 0), in metres. A bead sits one third of the way along from the top. Where is it?

  1. One third of the way along means the ratio 1 : 2.

Answer: (3, 4, 8)

Picture

Find the midpoint of the join of (2, −1, 4) and (4, 3, −2).

Answer: (3, 1, 1)

Direct

Find the point that divides the join of (1, −2, 3) and (3, 4, −5) in the ratio 2 : 3.

Answer: (9/5, 2/5, −1/5)

Reverse

In what ratio does the yz-plane divide the join of (−2, 4, 7) and (3, −5, 8)?

Try it first, then show the working
  1. On the yz-plane x = 0. With the ratio k : 1, (3k − 2) ÷ (k + 1) = 0, and so k = 2/3.
  2. The ratio is 2 : 3. Check: x = (2 × 3 + 3 × (−2)) ÷ 5 = 0.

Answer: 2 : 3

Exam

Using the section formula, show that A(2, −3, 4), B(−1, 2, 1) and C(0, 1/3, 2) lie on one line.

Try it first, then show the working
  1. Let C divide AB in the ratio k : 1. The x-coordinate gives (−k + 2) ÷ (k + 1) = 0, so k = 2.
  2. The y and z of C agree as well, so C is on AB: the points are collinear.

Answer: C divides AB in the ratio 2 : 1, so they are collinear

Common mistake: Pairing m1 with A's coordinates; m1 multiplies B's, since the point is closer to the end with the smaller share.

Class 11

Centroid of a triangle in space

What each letter means
the centroid: where the three medians of the triangle meet
the x-coordinate of the first corner
the y-coordinate of the first corner
the z-coordinate of the first corner
the x-coordinate of the second corner
the y-coordinate of the second corner
the z-coordinate of the second corner
the x-coordinate of the third corner
the y-coordinate of the third corner
the z-coordinate of the third corner

The centroid of a triangle is the average of its three corners, taken one coordinate at a time.

Why it works

The centroid lies on the median from the first corner A, two thirds of the way from A to the midpoint M of the opposite side. The section formula with the ratio 2 : 1 from A to M gives ((x₁ + x₂ + x₃) ÷ 3, …), and the same for y and z.

When to use it

Finding the balance point of a triangle in space, and finding a missing corner when the centroid is known.

How to use it

  1. Add the three x-coordinates and divide by 3.
  2. Do the same for y and for z.

To remember: The centroid is the average corner.

Other forms

  • To remember itThe centroid is two thirds of the way from each corner to the midpoint of the opposite side.

Worked examples

Story

Three drones hover at (2, 4, 6), (4, 0, 9) and (6, 2, 3), in metres. A camera is set at the centroid of their triangle. Where is it?

Answer: (4, 2, 6)

Picture

For A(0, 0, 0), B(6, 0, 0) and C(0, 6, 6), show that the centroid G is two thirds of the way from A to M, the midpoint of BC.

  1. G = (2, 2, 2), and M, the midpoint of BC, is (3, 3, 3).
  2. Each coordinate of G is two thirds of the way from A to M.

Answer: G = (2, 2, 2), two thirds of the way from A to M = (3, 3, 3)

Direct

Find the centroid of the triangle with corners (3, −5, 7), (−1, 7, −6) and (1, 1, 2).

Answer: (1, 1, 1)

Reverse

A triangle has centroid (1, 1, 1) and two corners (3, −5, 7) and (−1, 7, −6). Find the third corner.

Try it first, then show the working
  1. For each coordinate, take three times the centroid and subtract the two known corners.

Answer: (1, 1, 2)

Exam

The origin is the centroid of the triangle with corners (2a, 2, 6), (−4, 3b, −10) and (8, 14, 2c). Find a, b and c.

Try it first, then show the working
  1. Each coordinate of the centroid is 0: 2a − 4 + 8 = 0, 2 + 3b + 14 = 0 and 6 − 10 + 2c = 0.
  2. Solving each: a = −2, b = −16/3 and c = 2.

Answer: a = −2, b = −16/3, c = 2

Common mistake: Dividing by 2 as for a midpoint; three corners means dividing by 3.

Class 12

Direction cosines from direction ratios

What each letter means
the direction cosine along the x-axis: the cosine of the angle the line makes with it
the direction ratio along x
the direction ratio along y
the direction ratio along z

A line with direction ratios a, b, c makes angles with the axes whose cosines are a, b and c each divided by √(a² + b² + c²).

Why it works

The vector aî + bĵ + ck̂ points along the line. Dividing it by its length gives the unit vector along the line, and the components of a unit vector are the cosines of its angles with the axes.

When to use it

Describing the direction of a line in space, its angles with the axes, and the angle between two lines.

How to use it

  1. Find the direction ratios (for a line through two points, the differences of their coordinates).
  2. Divide each by √(a² + b² + c²): that gives l, m and n.

To remember: Divide the ratios by their length.

Other forms

  • Special caseWhen the line makes equal angles with the three axes (a = b = c).
  • To remember itThe three direction cosines always satisfy l² + m² + n² = 1.

Worked examples

Story

A drone climbs along 3î + 4ĵ + 12k̂. Find the cosine of the angle its path makes with the vertical (the z-axis).

  1. Put the upward ratio first: 12, with 3 and 4.

Answer: 0.9230769230769231

Picture

Find l for the line through (1, 2, 3) and (3, 4, 4).

  1. The direction ratios are the differences 3 − 1, 4 − 2 and 4 − 3: that is 2, 2 and 1.

Answer: 0.6666666666666666

Direct

A line has direction ratios 2, −1, −2. Find its direction cosine l.

  1. In the same way, m = −1/3 and n = −2/3.

Answer: 0.6666666666666666

Reverse

A line with direction ratios a, 2, 6 (a positive) has l = 3/7. Find a.

Try it first, then show the working

Answer: 3

Exam

A line makes angles of 90°, 135° and 45° with the x, y and z axes. Find its direction cosines.

Try it first, then show the working
  1. They are cos 90°, cos 135° and cos 45°: 0, −1/√2 and 1/√2. Check that their squares add up to 1:

Answer: 0, −1/√2, 1/√2

Common mistake: Forgetting to divide by the root; then l² + m² + n² is not 1.

Sources
  • NCERT: class-12/mathematics/11 section 11.2, Direction cosines and direction ratios of a line
  • OpenStax: Calculus Volume 3, 2.3 The Dot Product (direction cosines)
  • Wikidata: direction cosine

Class 12

Angle between two lines in space

What each letter means
the cosine of the angle θ between the two lines
the first line's direction ratio along x
the first line's direction ratio along y
the first line's direction ratio along z
the second line's direction ratio along x
the second line's direction ratio along y
the second line's direction ratio along z

The cosine of the angle between two lines is the dot product of their direction ratios divided by the product of their lengths, taken without its sign.

Why it works

The direction ratios are vectors along the two lines, and for vectors cos θ = (a · b) ÷ (|a| |b|). A line has no arrow, so the bars pick the acute angle between the lines.

When to use it

The angle between two lines in space, and testing whether lines are perpendicular (the top is 0) or parallel (the ratios are in proportion).

How to use it

  1. Read the direction ratios of each line (the numbers under x, y, z in the Cartesian form).
  2. Work out a₁a₂ + b₁b₂ + c₁c₂ and drop its sign.
  3. Divide by the two lengths, then take cos⁻¹ if the angle is wanted.

To remember: Dot the ratios, divide by their lengths.

Other forms

  • Special caseWhen the lines are perpendicular (cos θ = 0).
  • To remember itParallel lines have ratios in proportion: a₁/a₂ = b₁/b₂ = c₁/c₂.

Worked examples

Story

Two cables run along 3î + 4ĵ and 4î − 3ĵ + 5k̂. What is the angle between them?

  1. cos θ = 0, so the cables are at right angles.

Answer: 0

Picture

Find the angle between the x-axis (direction ratios 1, 0, 0) and the line with direction ratios 1, 1, 0.

  1. So the angle is 45°.

Answer: 0.7071067811865476

Direct

Find cos θ for lines with direction ratios 1, 2, 2 and 2, −1, 2.

Answer: 0.4444444444444444

Reverse

For which k are the lines with direction ratios 1, k, 2 and 2, 1, −2 perpendicular?

Try it first, then show the working
  1. Perpendicular lines need a₁a₂ + b₁b₂ + c₁c₂ = 0: 2 + k − 4 = 0, and therefore k = 2. Check:

Answer: k = 2

Exam

Find the angle between the lines (x − 2)/2 = (y − 1)/5 = (z + 3)/(−3) and (x + 2)/(−1) = (y − 4)/8 = (z − 5)/4.

Try it first, then show the working
  1. The direction ratios are 2, 5, −3 and −1, 8, 4, with lengths √38 and 9.
  2. So θ = cos⁻¹(26 ÷ (9√38)).

Answer: θ = cos⁻¹(26/(9√38))

Common mistake: Using the points on the lines instead of their direction ratios.