You’re sitting in math class trying to survive your latest pop quiz. The questions on Page 1 weren’t too hard, but on the second page, you see a graph with two little dots on it labeled “Point 1” and “Point 2.” And they’re connected together by a diagonal line.

Sweat trickles down your forehead as you read the prompt: *“Find the distance between these points.”*

Don’t panic. The distance formula you’re looking for is fairly straightforward — and it has ties to one of the most useful and famous concepts in all of mathematics: the Pythagorean theorem.

The Pythagorean Theorem Is Related to Distance Formula

The Pythagorean theorem was named for the Greek philosopher Pythagoras. But he can’t take sole credit for discovering it. Old Pythagoras lived from about 570 to 490 B.C.E. Yet more than 1,000 years before he was born, the ancient Babylonians were already aware of the geometric principle that now bears his name.

For those in need of a quick refresher, the Pythagorean theorem says:

*The area of the square built upon the hypotenuse of a right triangle is equal to the sum of the areas of the squares upon the remaining sides.*

We’ve got a couple of things to unpack here. A right angled triangle is one that contains one 90-degree angle, also known as a right angle. The longest line on a right triangle is called the hypotenuse. (This is also the line situated on the opposite side of the right angle.)

Now as we all know, a triangle may have three sides, but a square’s got four.

So imagine taking the hypotenuse of a right triangle and turning it into one of the four parallel lines of a brand-new square. Then do the same thing to the other two sides in the original triangle. You’ll end up with three individual squares.

As the Pythagorean theorem points out, the square you just made with the hypotenuse will have the same area as the other two squares put together. If the hypotenuse was labeled “c” and those other point were labeled “a” and “b,” then we could express that idea like so:

Distance Formula and the Point Coordinate Plane

When most people hear the word “graph,” they’re picturing a chart with two lines — one vertical, one horizontal — that intersect each other at a right angle. (Don’t confuse this with the formula between two parallel lines; that’s different.)

The vertical line is called the y-axis and its horizontal counterpart is the x-axis. Both lines work together to tell a story with data. Just take a look at this humorous graph from cartoonist Jorge Cham about somebody’s not-so-relaxing vacation where the y-axis is labeled “stress” and the x-axis is labeled “time.”

In order to make sense of where one point rests on your graph, you need to measure where it falls along both the x-axis and the y-axis. These are known as the point’s coordinates. You need to find the coordinate for the first point and the second point before you can calculate distance formula. The line segment is the straight line between the two points that you can measure.

How to Derive Distance Formula

Enough preamble. The question you want answered is how to find the distance between two points on a graph or two coordinates. That’s distance formula.

The first point and second point on your graph will each have an x coordinate and a y coordinate. The formula to calculate the shortest distance between these two points is derived from the Pythagorean theorem. Here it is, folks:

**D = √(x**_{2}**-x**_{1}**)**^{2}** + (y**_{2}**-y**_{1}**)**^{2}

Note that “D” means “distance.” As for x_{2} and x_{1}, they refer to the x coordinates of Point 2 and Point 1, respectively. Same goes for y_{2} and y_{1}, except those are the two y coordinates.

So to calculate the distance, our first step is need to subtract x_{1} from x_{2}. Then we have to multiply the resulting number by itself (or, in other words, “square” that number). After that, we must subtract y_{1} from y_{2} and then square the answer we get from doing so.

This will leave us with two numbers we must add together. Then finally, take that number and find its square root. And *that square root*, ladies and gentlemen, is our distance.

Distance Formula Example

OK, so let’s say Point 1 has an x coordinate of 2 and a y coordinate of 5. Let us also assume that Point 2’s got an x coordinate of 9 and a y coordinate of 11.

Plug those values into the handy dandy formula and you get this:

**D = √(9-2)**^{2}** + (13-5)**^{2}

What’s 9 minus 2? Easy, 7. And 13 minus 5 is 8, of course.

So now we’re left with this:

**D = √7**^{2}** + 8**^{2}

If you “square” 7 — as in, multiply the number by itself — you end up with 49. As for 8 squared that works out to 64. Let’s plug those values into the equation, eh?

**D = √49 + 64**

Now we’re cooking. Add 49 and 64 and you get 113.

**D = √113**

What’s the square root of 113? The answer is 10.63, so therefore:

**D = 10.63**

Go forth and ace that pop quiz!