Suppose, city A is located 50 km east and 20 km north from city B. Then, how can we calculate the distance between the two cities, without actually measuring it? Here, we can make use of Pythagoras theorem, by forming a right-triangle in a plane using the directions given. In this article, learn how we can use this theorem to find the distance between two Cartesian points and distance between two positions (points) in a plane.

To calculate the **distance between two points** in a plane, we have to use the distance formula derived in coordinate geometry. With the help of this formula, we can find the distance between any two points marked in the xy-plane. This is one of the important topics covered in Class 10 Maths Chapter 7.

**Also, read:**

**How to use Pythagoras theorem to find the distance between two positions?**

Consider the following situation.

A boy walks towards north 30 meters and took a turn to the east and walked for 40 meters more. How do we calculate the shortest distance between the initial place and final place?

A pictorial representation of the above situation is:

The initial point is A and final point is C. The distance between the points A, B is 30 m and between points B, C is 40 m.

The shortest distance between points A and C is AC.

This is calculated using **Pythagoras theorem **as follows.

AC^{2}Â = AB^{2} + BC^{2}

\( AC \) = \( \sqrt{30^2~+~40^2}\) = 50 m

Hence, we got the distance between the start point and the endpoint.Â In the same way, the distance between two points in a coordinate plane is also calculated using the Pythagorean theorem or right-angles triangle theorem.

Before going to derive the formula for distance between two points in a coordinate plane, let us understand what are the coordinate points and how to locate them in the Cartesian plane.

## Coordinates of a point

Two-dimensional geometry deals with coordinates of points, distance between the points etc. Coordinates of a point is a pair of numbers which exactly define the location of that point in the coordinate plane.

Coordinates of the point P in the two-dimensional plane is (x, y) which means, P is x units away from y-axis and y units away from the x-axis.

Coordinates of a point on the x-axis are of the form (a, 0), where a is the distance of the point from the origin and on the y-axis is of the form (0, a), where a is the distance of the point from the origin.

## Distance Formula

Let us take two points P(x_{1}, y_{1})Â and Q(x_{2}, y_{2})Â in the coordinate plane. Let us represent these points in the figure.

Note that we have taken our points P and Q in the first quadrant itself. What if the points are in other quadrants? As you shall observe in the following discussion, the final formula still remains the same, irrespective of which quadrant P and Q lie in.

PS, QT are perpendicular to x-axis and PR is parallel to the x-axis.

**Distance between the points P and Q is calculated as follows:**

S and T are the points on the x-axis which are endpoints of two parallel line segments PS and QT respectively.

â‡’ PR = ST

Coordinates of S and T are (x_{1}, 0) and Â (x_{2}, 0)Â respectively.

OSÂ = Â x_{1Â }and OTÂ = x_{2}

STÂ = OT – OSÂ = x_{2}– x_{1}Â = PR

Similarly,

PS = Â RT

QR = QT – RT = QT – PS =Â y_{2}– y_{1}

By Pythagoras theorem,

PQ^{2Â }= PR^{2Â }+ QR^{2}

PQ = âˆš[(x_{2}– x_{1})^{2}+ (y_{2}– y_{1})^{2}]

Therefore,

Distance between two points (x_{1},y_{1})Â and (x_{2},y_{2})Â is given by:

PQ = âˆš[(x_{2}– x_{1})^{2}+ (y_{2}– y_{1})^{2}]

It is known as **distance formula.**

Observe that (x_{2}– x_{1})^{2}Â is the square of the difference in x â€“ coordinates of P and Q and is always positive. The same can be said about (y_{2}– y_{1})^{2Â }as well. Use this point and try to see for yourself why the formula remains the same for any coordinates of P and Q, in any quadrant.

### Distance between a point from the origin

Suppose a point P(x, y) in the xy – plane as shown in the figure below:

Let us calculate the distance between point P and the origin. P is x units away from y-axis and y units away from the x-axis.

By Pythagoras theorem,

OP^{2}Â = x^{2Â }+ y^{2}

\( OP \) = \( \sqrt{x^2~+~y^2} \)

Therefore distance between any point (x, y) in xy-plane and the origin (0, 0) isÂ \( \sqrt{x^2~+~y^2} \).

### Examples

**Example 1: Find the value of a, if the distance between the points P(3, -6) and Q(-3, a) is 10 units.**

Solution:

Let the given points be:

P(3, -6) = (x_{1}, y_{1})

Q(-3, a) = (x_{2}, y_{2})

Using distance formula,

Distance between the points P(3, -6) and Q(-3, a) is:

[(-3 – 3)^{2Â }+ (a + 6)^{2}] = 10 units (given)

Squaring on both sides of the equation,

(-6)^{2Â }+ (a + 6)^{2}Â = 100

(a + 6)^{2}Â = 100 – 36Â = 64Â

Taking root on both the sides, we get;

a + 6 = Â±8

**Case I: Considering +8,**

a + 6 = 8Â ,

a = 8 – 6 = 2

**Case II: Considering -8**

a + 6Â = -8

a = -8 – 6

a = -14

Therefore, the coordinates are either P(3, -6) and Q(-3, 2) or P(3, -6) and Q(-3, -14).

**Example 2:Â Find a relation between x and y such that the point (x, y) is equidistant from the points (7, 1) and (3, 5).**

Solution:Â Let P(x, y) be the point which is equidistant from the points A(7, 1) and B(3, 5).

Given,

AP = BP

â‡’ AP^{2Â }= BP^{2}

(x â€“ 7)^{2Â }+ (y â€“ 1)^{2Â }= (x â€“ 3)^{2Â }+ (y â€“ 5)^{2Â } (by distance formula)

x^{2Â }â€“ 14x + 49 + y^{2Â }â€“ 2y + 1 = x^{2Â }â€“ 6x + 9 + y^{2Â }â€“ 10y + 25

-14x + 50 – 2y + 6x + 10y – 34 = 0

-8x + 8y = -16

x â€“ y = 2

This is the required relation between x and y.

**Example 3:Â Find a point on the y-axis which is equidistant from the points A(6, 5) and B(â€“ 4, 3).**

Solution:Â We know that a point on the y-axis is of the form (0, y). So, let the point P(0, y) be equidistant from A and B. Then:

AP = BP

â‡’ AP^{2Â }= BP^{2}

(6 â€“ 0)^{2Â }+ (5 â€“ y)^{2Â }= (â€“ 4 â€“ 0)^{2Â }+ (3 â€“ y)^{2}

36 + 25 + y^{2}â€“ 10y = 16 + 9 + y^{2Â }â€“ 6y

61 – 10y = 25 – 6y

â‡’ 10y – 6y = 61 – 25

â‡’ 4y = 36

â‡’ y = 9

So, the required point is (0, 9).

Verification:

AP =Â âˆš[(6 â€“ 0)^{2Â }+ (5 â€“ 9)^{2}]

= âˆš(36+16)

= âˆš52

BP =Â Â âˆš[(-4-0)^{2}+(3-9)^{2}]

=âˆš(16+36)

=âˆš52

Hence, we conclude that, the point (0, 9) is equidistant from the give two points.

### Distance Between Two Points in 3D

The distance between two points A(x_{1}, y_{1}, z_{1}) and B(x_{2}, y_{2}, z_{2}) in a three-dimensional plane is given by the formula:

AB =Â âˆš[(x_{2} – x_{1})^{2} + (y_{2} – y_{1})^{2} + (z_{2} – z_{1})^{2}]

Here,

(x_{2}– x_{1})^{2}Â is the square of the difference in x â€“ coordinates of A and B and is always positive.

Similarly, (y_{2}– y_{1})^{2Â }andÂ (z_{2}– z_{1})^{2Â }are equal to the square of the difference between the corresponding y and zâ€“ coordinates of A and B.

To learn more about coordinate geometry and related topics, log onto www.byjus.com. To watch interesting videos on the topic, download BYJU’S – The Learning App.