Associated Topics || Dr. Math Home || Search Dr. Math

### Length of a Line Segment in Three Dimensions

```Date: 04/16/2004 at 13:58:26
From: Catherine
Subject: Length of a line segment in three dimensions

What is the length of a line segment in three dimensions with
endpoints (1, 0, 2) and (1, 4, 5)?

```

```
Date: 04/16/2004 at 16:00:33
From: Doctor Douglas
Subject: Re: Length of a line segment in three dimensions

Hi, Catherine.

Thanks for writing to the Math Forum.

You can apply the Pythagorean Theorem twice in succession.  Consider
the box below:

B-------C    We want to know the distance between A and G.
/|      /|    We know the length (AD), height (DH) and width (HG).
A-------D |
| F-----|-G    The vertices AHG form a right triangle, because
|/      |/     the segment GH is perpendicular to the plane ADHE.
E-------H

We apply the Pythagorean theorem first to triangle AHG, and in doing
so, find we need to apply it again to get the distance AH:

(AG)^2 = (GH)^2 + (AH)^2                     Pythagoras (AHG)
= width^2 + length^2 + height^2

The body diagonal distance (AG) is simply the square root of this, or

distance = sqrt[width^2 + length^2 + height^2].

Let's think of the length of the box in terms of the x-coordinates of
the points, the height in terms of y, and the width in terms of z.  In
other words, think of the box as being on this axis system:

y  z
| /
|/
-----+----- x
/|
/ |

Since each of those three distances is one-dimensional, we can think
of the length of the box as the difference in the two x-coordinates,
the width as the difference in the two z-coordinates, and the height
as the difference in the two y-coordinates.  Thus, modifying the above
distance formula:

distance = sqrt[width^2 + length^2 + height^2]

distance = sqrt[(z2 - z1)^2 + (x2 - x1)^2 + (y2 - y1)^2]

In other words, we've discovered that by using the Pythagorean theorem
twice, we can find the distance between any two points (x1,y1,z1) and
(x2,y2,z2) in three dimensional space by calculating:

distance = sqrt[(z2 - z1)^2 + (x2 - x1)^2 + (y2 - y1)^2]

Are you familiar with the distance formula in two dimensions?  Given
two points (x1,y1) and (x2,y2), the distance between them is:

distance = sqrt[(x2 - x1)^2 + (y2 - y1)^2]

Can you see how the three dimensional formula is a logical extension
of this formula?

Now, can you use the three dimensional distance formula to find the

- Doctor Douglas, The Math Forum
http://mathforum.org/dr.math/
```
Associated Topics:
High School Polyhedra

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search