Distance Formula


Trigonometry Logo

Distance Formula

The distance formula, in coordinate geometry or Euclidean geometry, is used to find the distance between the two points in an XY plane. The distance of a point from the y-axis is called its x-coordinate, or abscissa. The distance of a point from the x-axis is called its y-coordinate, or ordinate. The coordinates of a point on the x-axis are of the form (x, 0), and of a point on the y-axis are of the form (0, y). To find the distance between any two points in a plane, we make the use of Pythagoras theorem here. This is an important topic for Class 10 students. Let us discuss more here, the formula, its derivation with examples.

Distance Formula in Maths

In maths, the distance formula is defined for coordinate geometry. Students should not get confused here for the formula for speed and distance. Both are completely two different topics. When we speak about speed and distance, it is covered under real-life scenarios when a person or a vehicle moves at a speed to cover a distance at a particular interval of time. Then the speed is equal to the ratio of distance covered and time taken.

In case of coordinate geometry, when a person moves from one point to another point in a plane, then the distance between the start point and endpoint is calculated using the distance formula. Let us learn its formula in the next section.

What is the distance formula?

The distance formula is the formula, which is used to find the distance between any two points, only if the coordinates are known to us. These coordinates could lie in x-axis or y-axis or both. Suppose, there are two points, say P and Q in an XY plane. The coordinates of point P are (x1,y1) and of Q are (x2,y2). Then the formula to find the distance between two points PQ is given by:

PQ = √[(x2 – x1)2 + (y2 – y1)2]


D = √[(x2 – x1)2 + (y2 – y1)2]

Where D is the distance between the points.

Distance Formula Derivation

Let P(x1, y1) and Q(x2, y2) be the coordinates of two points on the coordinate plane.

Draw two lines parallel to both x-axis and y-axis (as shown in the figure) through P and Q.

The parallel line through P will meet the perpendicular drawn to the x-axis from Q at T.

Thus, ΔPTQ  is right-angled at T.

PT = Base, QT = Perpendicular and PQ = Hypotenuse

By Pythagoras Theorem,

PQ2 = PT2 + QT2

= (x2 – x1)2 + (y2 – y1)2

PQ = √[(x2 – x1)2 + (y2 – y1)2]

Hence, the distance between two points (x1, y1) and (x2, y2) is √[(x2 – x1)2 + (y2 – y1)2]

Similarly, the distance of a point P(x, y) from the origin O(0, 0) in the Cartesian plane is given by the formula:

OP = √(x2 + y2)

Distance Formula Examples

Let us solve some problems based on the distance formula.

Example 1: Find the distance between the two points A(1, 2) and B(-2, 2).

Solution: Given, two points A and B have coordinates (1, 2) and (-2, 2) respectively.

Let A(1, 2) = (x1, y1)

B(-2, 2) = (x2, y2)

To find: the distance between A and B

By the formula of distance between two points,

D = √[(x2 – x1)2 + (y2 – y1)2]

AB = √[(-2 – 1)2 + (2 – 2)2]

AB = (-3)2 + (0)2

AB = 9 = 3 unit.

Example 2: Show that the points (1, 7), (4, 2), (–1, –1) and (– 4, 4) are the vertices of a square.

Solution: Let P(1, 7), Q(4, 2), R(–1, –1) and S(– 4, 4) are the coordinates of four points in an XY plane.

To prove: PQRS is a square

Solution: To prove points P, Q, R and S form a square, we have to prove that:

PQ = QR = RS = PS (Lengths of the square)

PR = QS (Diagonals of the square)

Now by the distance formula, we will find the distance between PQ, QR, RS, PS, PR and QS.

PQ = √[(1 – 4)2 + (7-2)2] = √(9 + 25) = √34

QR = √[(4+1)2 + (2+1)2] = √(25 + 9) = √34

RS = √[(–1+ 4)2+ (–1 – 4)2] = √(9 + 25) = √34

PS = √[(1+4)2 + (7 – 4)2] = √(25 + 9) = √34

PR =√[(1+1)2+(7+1)2] = √(4+64) = √68

QS = √[(4+4)2 + (2-4)2] = √(64+4) = √68

Since, PQ = QR = RS = PS and PR = QS.

Therefore, PQRS is a square.

Frequently Asked Questions – FAQs

What is the formula for distance?

In general, the distance traveled by an object with a certain speed at a specific speed is calculated using the formula given below:
d = st
d = Distance
s = Speed
t = Time

What is a distance in math?

The distance between two points is the length of the line segment, joining the given two points. The distance of a point from a line will be the shortest line segment’s length from the point to the line.

What is the distance between 2 points?

As we know, the distance between two points is the length of the line segment, joining the given two points. Suppose (x1, y1) and (x2, y2) be the two points, then the distance between them is given by √[(x2 – x1)^2 + (y2 – y1)^2].

What is an example of distance?

The general definition of a distance is the measure of length or space between two objects or the persons in the disconnected position. An example of distance is four meters between two poles in the street.

How to calculate the distance?

Distance can be calculated using the formula derived from Pythagoras theorem. In coordinate geometry, the distance formula is √[(x2 – x1)^2 + (y2 – y1)^2].