Finding the Distance Between Two Points in a Three Dimensional Space

Instructor: Gerald Lemay

Gerald has taught engineering, math and science and has a doctorate in electrical engineering.

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:

Distance 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

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it risk-free for 30 days

Earning College Credit

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.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account