# Distance Formula in Coordinate Geometry

Coordinate Geometry is helpful to define the points in space. It helps in plotting various geometrical figures like square, rectangle, triangle, circle, ellipse, etc., and studying their properties. One of the main concepts that is common to all the figures is the distance between points.

The distance formula in coordinate geometry is used to find the distance between any two points $(x_1, y_1)$ and $(x_2, y_2)$. Let’s understand what is a coordinate geometry distance formula, its derivation, and its use in coordinate geometry.

## Coordinate Geometry Distance Formula

The distance formula is used to find the distance between two points in a two-dimensional plane. It is also known as the Euclidean distance formula. According to the distance formula, the distance between any two points $\text{A}(x_1, y_1)$ and $\text{B}(x_2, y_2)$ is given by $|\overline{\text{AB}}| = \sqrt{(x_2 – x_1)^2 + (y_2 – y_1)^2}$.

### Distance of a Point From Origin

The distance between any two points $\text{A}(x_1, y_1)$ and $\text{B}(x_2, y_2)$ is given by $|\overline{\text{AB}}| = \sqrt{(x_2 – x_1)^2 + (y_2 – y_1)^2}$.

Using the above formula, we can find the distance of any point $\text{P}(x, y)$ from the origin $\text{O}(0, 0)$.

Distance between $\text{O}(0, 0)$ and $\text{P}(x, y)$ is $|\overline{\text{OP}}| = \sqrt{(x – 0)^2 + (y – 0)^2}$

$= \sqrt{x^2 + y^2}$

### Examples on Distance Formula

Example 1: Find the distance between the points $\text{P}(5, 8)$ and $\text{Q}(-7, 2)$.

According to distance formula distance between $\text{A}(x_1, y_1)$ and $\text{B}(x_2, y_2)$ is given by $|\overline{\text{AB}}| = \sqrt{(x_2 – x_1)^2 + (y_2 – y_1)^2}$.

Therefore distance between $\text{P}(5, 8)$ and $\text{Q}(-7, 2)$ is $|\overline{\text{PQ}}| = \sqrt{(-7 – 5)^2 + (2 – 8)^2}$

$= \sqrt{(-12)^2 + (-6)^2}$

$= \sqrt{144 + 36} = \sqrt{180}$

$= \sqrt{2^2 \times 3^2 \times 5} = 6 \sqrt{5}$ units

Example 2: Find the distance between the points $\text{A}(a, b)$ and $\text{B}(b, a)$.

According to distance formula distance between $\text{A}(x_1, y_1)$ and $\text{B}(x_2, y_2)$ is given by $|\overline{\text{AB}}| = \sqrt{(x_2 – x_1)^2 + (y_2 – y_1)^2}$.

Therefore distance between $\text{A}(a, b)$ and $\text{B}(b, a)$ is $|\overline{\text{AB}}| = \sqrt{(b – a)^2 + (a – b)^2}$

$= \sqrt{b^2 + a^2 – 2ab + a^2 + b^2 – 2ab}$

$= \sqrt{2a^2 + 2b^2 – 4ab} = \sqrt{2(a^2 + b^2 – 2ab)}$

$= \sqrt{2(a – b)^2} = \sqrt{2}(a – b)$

Example 3: If the distance between the points $(5, – 2)$ and $(1, a)$ is $5$, find the values of $a$.

According to distance formula distance between $\text{A}(x_1, y_1)$ and $\text{B}(x_2, y_2)$ is given by $|\overline{\text{AB}}| = \sqrt{(x_2 – x_1)^2 + (y_2 – y_1)^2}$.

Therefore distance between $(5, – 2)$ and $(1, a)$ is $\sqrt{(1 – 5)^2 + (a – (-2))^2}$

$= \sqrt{(-4)^2 + (a + 2)^2}$

$= \sqrt{16 + a^2 + 4a + 4}$

$= \sqrt{a^2 + 4a + 20}$ units

Thus $= \sqrt{a^2 + 4a + 20} = 5$

Squaring both sides $a^2 + 4a + 20 = 5^2$

$=> a^2 + 4a + 20 = 25$

$=> a^2 + 4a + 20 – 25 = 0$

$=> a^2 + 4a – 5 = 0$

$=> a^2 – a + 5a – 5 = 0$

$=> a(a – 1) + 5(a – 1) = 0$

$=> (a – 1)(a + 5) = 0$

$=> a – 1 = 0$ or $a + 5 = 0$

$=> a = 1$ or $a = -5$

Example 4: Derive the equation of a circle with centre at $(h, k)$ and radius $r$.

Circle is a plane figure in which every point lying on its circumference is at a fixed distance from the centre. And this fixed distance is equal to the radius of a circle.

Let $\text{P}(x, y)$ be any point lying on the circumference of a circle.

Then distance of $\text{P}(x, y)$ from the centre $\text{O}(h, k)$ is $\sqrt{(h – x)^2 + (k – y)^2}$

$= \sqrt{h^2 + x^2 – 2hx + k^2 + y^2 – 2ky}$

$= \sqrt{x^2 + y^2 – 2hx – 2ky + h^2 + k^2}$

Since this distance is equal to the radius $r$, therefore $\sqrt{x^2 + y^2 – 2hx – 2ky + h^2 + k^2} = r$

Squaring both sides, we get $x^2 + y^2 – 2hx – 2ky + h^2 + k^2 = r^2$ which is the equation of a circle with centre $(h, k)$ and radius $r$.

When the centre of the circle is at origin $(0, 0)$, then $h = 0$ and $k = 0$, then equation of circle becomes $x^2 + y^2 – 2 \times 0 \times x – 2 \times 0 \times y + 0^2 + 0^2 = r^2 => x^2 + y^2 – 0 – 0 + 0 + 0 = r^2 => x^2 + y^2 = r^2$

Example 5: Find the coordinates of points on the $x$-axis which are at a distance of $5$ units from the point $(6, -3)$.

Any point lying on the $x$-axis is of the form $(x, 0)$.

The distance of $(x, 0)$ from $(6, -3)$ is $\sqrt{(6 – x)^2 + (-3 – 0)^2}$

$= \sqrt{6^2 + x^2 – 12x + (-3)^2}$

$= \sqrt{36 + x^2 – 12x + 9}$

$= \sqrt{x^2 – 12x + 45}$

Therefore $\sqrt{x^2 – 12x + 45} = 5$

Squaring both sides $x^2 – 12x + 45 = 25$

$=> x^2 – 12x + 45 – 25 = 0$

$=> x^2 – 12x + 20 = 0$

$=> x^2 – 2x – 10x + 20 = 0$

$=> x(x – 2) – 10(x – 2) = 0$

$=> (x – 2)(x – 10) = 0$

$=> x – 2 = 0$ or $x – 10 = 0$

$=> x = 2$ or $x = 10$

Thus the points on the $x$-axis which are at a distance of $5$ units from the point $(6, -3)$ are $(2, 0)$ and $(10, 0)$.

Example 6: Which point on the $y$-axis is equidistance from the points $(12, 3)$ and $(-5, 10)$?

Any point lying on the $y$-axis is of the form $(0, y)$.

The distance of $(0, y)$ from $(12, 3)$ is $\sqrt{(12 – 0)^2 + (3 – y)^2}$

$= \sqrt{(12)^2 + 3^2 + y^2 – 6y}$

$= \sqrt{(12)^2 + 3^2 + y^2 – 6y}$

$= \sqrt{144 + 9 + y^2 – 6y}$

$= \sqrt{153 + y^2 – 6y}$ ———————– (1)

The distance of $(0, y)$ from $(-5, 10)$ is $\sqrt{(-5 – 0)^2 + (10 – y)^2}$

$= \sqrt{(-5)^2 + 10^2 + y^2 – 20y}$

$= \sqrt{25 + 100 + y^2 – 20y}$

$= \sqrt{125 + y^2 – 20y}$ ————————- (2)

Since the points $(12, 3)$ and $(-5, 10)$ are equidistant from a point on $y$-axis, therefore from (1) and (2)

$\sqrt{153 + y^2 – 6y} = \sqrt{125 + y^2 – 20y}$

Squaring both sides

$153 + y^2 – 6y = 125 + y^2 – 20y$

$=> 153 + y^2 – 6y – 125 – y^2 + 20y = 0$

$=> 28 + 14y = 0$

$=> 14y = -28 => y = -\frac{28}{14} => y = -2$

Therefore, the required point on the y-axis = (0, -2).

## Derivation of Distance Formula

Let $\text{P}(x_1, y_1)$ and $\text{Q}(x_2, y_2)$ be the coordinates of two points on the coordinate plane.

The parallel line through $\text{P}$ will meet the perpendicular drawn to the $x$-axis from $\text{Q}$ at $\text{T}$.

Thus, $\triangle \text{PTQ}$  is right-angled at $\text{T}$.

By Pythagorean Theorem,

$\text{PQ}^2 = \text{PT}^2 + \text{QT}^2$

$= (x_2 – x_1)^2 + (y_2 – y_1)^2$

$=> |\overline{\text{PQ}}| = \sqrt {(x_2 – x_1)^2 + (y_2 – y_1)^2}$

Hence, the distance between two points $(x_1, y_1)$ and $(x_2, y_2)$ is $\sqrt {(x_2 – x_1)^2 + (y_2 – y_1)^2}$

## Practice Problems

1. Find the distance between the following pair of points.
• $(5, 9)$ and $(7, 4)$
• $(-2, 6)$ and $(3, -1)$
• $(-a, 0)$ and $(0, b)$
• $(a, 2b)$ and $(2a, b)$
2. Find the values of a such that $\text{PQ} = \text{QR}$, where $\text{P}$, $\text{Q}$ and $\text{R}$ are the points whose coordinates are $(6, – 1)$, $(1, 3)$ and $(a, 8)$ respectively.
3. Find the points on the $y$-axis, each of which is at a distance of $13$ units from the point $(-5, 7)$.
4. Show that the points $\text{A} (8, 3)$, $\text{B} (0, 9)$ and $\text{C} (14, 11)$ are the vertices of an isosceles right-angled triangle.
5. Prove that the points $\text{A} (1, 2)$, $\text{B} (5, 4)$, $\text{C} (3, 8)$ and $\text{D} (-1, 6)$ are the vertices of a rectangle.

## FAQs

### What is a distance in maths?

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 formula for the distance between two points?

The distance between two points is the length of the line segment, joining the given two points. If $(x_1, y_1)$ and $(x_2, y_2)$ are the two points, then the distance between them is given by $\sqrt {(x_2 – x_1)^2 + (y_2 – y_1)^2}$.

### How to calculate the distance between two points?

The distance can be calculated using the formula derived from the Pythagoras theorem. In coordinate geometry, the distance formula is $\sqrt {(x_2 – x_1)^2 + (y_2 – y_1)^2}$.

### How is the distance formula derived?

The distance formula is derived from the Pythagorean theorem, which is used to find the distance between two points in the plane.

### What is 2D distance formula?

The 2D distance formula gives the shortest distance between two points in a two-dimensional plane. The formula says the distance between two points $(x_1, y_1)$ and $(x_2, y_2)$ is given by $\sqrt {(x_2 – x_1)^2 + (y_2 – y_1)^2}$.

### How is the Pythagorean theorem related to the distance formula?

The Pythagorean formula is used to find the derivation of the distance formula. The distance between two points $(x_1, y_1)$ and $(x_2, y_2)$ is calculated by $\text{Distance}^2 = (x_2 – x_1)^2 + (y_2 – y_1)^2$ where $(x_1, y_1)$ and $(x_2, y_2)$ are two vertices of a right-angled triangle that form its hypotenuse when joined.

## Conclusion

The distance formula helps construct new buildings, find locations, route new ways in emergent cases, and much more. Using the concepts of Coordinate Geometry and the Pythagorean theorem, we can derive a formula for the distance between two points $(x_1, y_1)$ and $(x_2, y_2)$ as $\sqrt {(x_2 – x_1)^2 + (y_2 – y_1)^2}$, which is commonly known as the distance formula.