Skip to main content

1. Distance Formula

See also:

The Cartesian Plane

The cartesian plane was named after Rene Descartes.

See more about Descartes in Functions and Graphs.

We have a right-angled triangle with hypotenuse length c, as shown:

Recall Pythagoras' Theorem, which tells us the length of the longest side (the hypotenuse) of a right triangle:


We use this to find the distance between any two points (x1, y1) and (x2, y2) on the cartesian (x-y) plane:

x y
A (x1, y1)
B (x2, y1)
C (x2, y2)
distance = d

The point B (x2, y1) is at the right angle. We can see that:

  • The distance between the points A(x1, y1) and B(x2, y1) is simply x2x1 and
  • The distance between the points C(x2, y2) and B(x2, y1) is simply y2y1.
x y
A (x1, y1)
B (x2, y1)
C (x2, y2)
x2 − x1
y2 − y1
distance = d

Distance from (x1, y1) to (x2, y2).

Using Pythagoras' Theorem we can develop a formula for the distance d.

Continues below

Distance Formula

The distance between (x1, y1) and (x2, y2) is given by:


Note: Don't worry about which point you choose for (x1, y1) (it can be the first or second point given), because the answer works out the same.

Interactive Graph - Distance Formula

You can explore the concept of distance formula in the following interactive graph (it's not a fixed image).

Drag either point A (x1, y1) or point C (x2, y2) to investigate how the distance formula works.

Length AB = x2x1

Length BC = y2y1


Copyright ©

Example 1

Find the distance between the points (3, −4) and (5, 7).


Here, x1 = 3 and y1 = −4; x2 = 5 and y2 = 7

So the distance is given by:





Example 2

Find the distance between the points (3, −1) and (−2, 5).


This time, x1 = 3 and y1 = −1; x2 = −2 and y2 = 5

So the distance is given by:






Example 3

What is the distance between (−1, 3) and (−8, −4)?


In this example, x1 = −1 and y1 = 3; x2 = −8 and y2 = −4

So the distance is given by:






Example 4

Find k if the distance between (k,0) and (0, 2k) is 10 units.


This is the situation:

Graph solution - straight line

Applying the distance formula, we have:





Now `sqrt(5k^2)=10` so `5k^2=100`, giving:

k2 = 20



We obtained 2 solutions, so there are 2 possible outcomes, as follows:

Graph solutions - 2 straight line

Please support IntMath!


Search IntMath, blog and Forum

Search IntMath

Online Math Solver

This math solver can solve a wide range of math problems.

Math Lessons on DVD

Math videos by

Easy to understand math lessons on DVD. See samples before you commit.

More info: Math videos

The IntMath Newsletter

Sign up for the free IntMath Newsletter. Get math study tips, information, news and updates each fortnight. Join thousands of satisfied students, teachers and parents!

See the Interactive Mathematics spam guarantee.