# Distance formula

Walk through deriving a general formula for the distance between two points.

The between the points and is given by the following formula:

In this article, we're going to derive this formula!

## Deriving the distance formula

Let's start by plotting the points and .

The length of the segment between the two points is the between them:

We want to find the . If we draw a right triangle, we'll be able to use the Pythagorean theorem!

An expression for the length of the base is :

Similarly, an expression for the length of the height is :

Now we can use the Pythagorean theorem to write an equation:

We can solve for by taking the square root of each side:

That's it! We derived the distance formula!

Interestingly, a lot of people don't actually memorize this formula. Instead, they set up a right triangle, and use the Pythagorean theorem whenever they want to find the distance between two points.