Distance Between 2 Points

Here is how to calculate the distance between two points when you know their coordinates:

Let us call the two points A and B

We can run lines down from A, and along from B, to make a Right Angled Triangle.

And with a little help from Pythagoras we know that:

a2 + b2 = c2

Now label the coordinates of points A and B.

xA means the x-coordinate of point A
yA means the y-coordinate of point A

The horizontal distance a is (xA − xB)

The vertical distance b is (yA − yB)

Now we can solve for c (the distance between the points):

Put in the calculations for a and b:c2 = (xA − xB)2 + (yA − yB)2
And the final result:

Examples

Example 1

 Fill in the values:

Example 2

It doesn't matter what order the points are in, because squaring removes any negatives:

 Fill in the values:

Example 3

And here is another example with some negative coordinates ... it all still works:

 Fill in the values:

(Note √136 can be further simplified to 2√34 if you want)

Drag the points:

Three or More Dimensions

It works perfectly well in 3 (or more!) dimensions.

Square the difference for each axis, then sum them up and take the square root:

Distance = √[ (xA − xB)2 + (yA − yB)2 + (zA − zB)2 ]

Example: the distance between the two points (8,2,6) and (3,5,7) is:

 = √[ (8−3)2 + (2−5)2 + (6−7)2 ] = √[ 52 + (−3)2 + (−1)2 ] = √( 25 + 9 + 1 ) = √35 Which is about 5.9