In this lesson we use Pythagoras' theorem and right triangles to develop an equation to find the distance between any two points in a three-dimensional space.
Imagine a math-enabled dolphin named Dolphinius relaxing underwater in a large tank. Dolphinius wants to swim from his present location to another point in this three-dimensional world. Of course, before heading out, our fastidious friend would like to calculate the shortest distance between these points. Any other route would waste precious dolphin energy.
In this lesson, we will develop an equation to find the distance between any two points in 3D space. This information will be of great help to Dolphinius.
A Point in a Three-Dimensional Space
Three dimensions in the Cartesian coordinate system means x, y and z-axes. In this world, the z-axis points straight up. What if we place a point in the x-y plane? For clarity, this point is colored green.
A point in the x-y plane
The place where x, y and z are all zero is called the origin. A line from the origin to the point is labeled c. Along the y-axis is a distance y2. Completing the triangle is x2 which parallels the x-axis. The reason for the ''2'' subscripts is to prepare us for what is coming later. For now, let's focus on the right triangle formed from the lengths x2, y2, and c. Looking down into the x-y plane we see
Triangle in the x-y plane
In a right triangle, the longest side, labeled c, is called the hypotenuse. From Pythagoras' theorem,
A Second Point in Three-Dimensional Space
By now you and Dolphinius might be getting the idea of locating points by drawing a line from the origin and then looking for a right triangle. Let's place another green point in our space a distance d from the origin:
A second point
Looking towards the origin from some point on the positive x-axis shows another right triangle:
Line c is the same as before and distance d we've already described. What about z2? It's the length of point d in the z direction, making a line parallel to the z-axis. This line segment forms a 90o angle with the x-y plane. From Pythagoras:
Now we are getting somewhere because we can substitute for c:
If we take the square root of both sides:
d is the distance. In this example, d is the distance from the origin to the second point. The origin can be written as (0, 0, 0). If we include this ''0'' information:
Distance Between Two Points in Three-Dimensional Space
Dolphinius, being a clever dolphin, likes results to be as general as possible. Let's say we have two arbitrary points in space and want to know the distance between them.
Distance between two arbitrary points
Over 79,000 lessons in all major subjects
Get access risk-free for 30 days,
just create an account.
One of the points is at (x1, y1, z1). The other point is at (x2, y2, z2). Instead of the distance from the origin at (0, 0, 0) we have the distance from the point (x1, y1, z1).
The equation for the distance d:
We now take Dolphinius through two examples to test out the math.
Example: Find the distance between the two points (0, 0, 3) and (0, 0, -3).
These two points are on the z-axis and the distance between them is 6. What about using the equation?
What if we had reversed the points?
Because of the squaring, which point is ''1'' and which point is ''2'' does not matter.
Example: Find the distance between (-1, 2, -5) and (1, -2, 5).
We use the equation that gives us the distance between two points:
We have developed a distance equation and done some calculations. What could make a dolphin happier?
The origin is the location where x, y and z are all zero. The hypotenuse is the longest side in a right triangle. Pythagoras' theorem relates the lengths of the sides in a right triangle. Using Pythagoras' theorem we found the distance between two arbitrary points in a three-dimensional space.
For two points with coordinates (x1, y1, z1) and (x2, y2, z2), the distance, d, is
Did you know… We have over 200 college
courses that prepare you to earn
credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the
first two years of college and save thousands off your degree. Anyone can earn
credit-by-exam regardless of age or education level.