Distance refers to a mathematical quantity that shows how far the two points lie from each other. Indeed, distance is one of the essential mathematical quantities. It plays a significant role in advanced mathematics and physics. It helps to determine the velocity of a moving object, magnitude, and direction of gravitational and electrical forces, and it helps with signal processing too. In mathematics, the distance formula is used for finding the distance between two points in a coordinate plane. The distance between the two points formula can be evaluated when you know the coordinates of the two points in a plane. By inserting those points in the formula, you can quickly find the distance between two points. In this article, you can learn about the distance between two points in 3D, its formula, and examples.
Distance Between Two Points Formula
Typically, in 2D space, each point in the space gets qualified by two parameters: xcoordinate and ycoordinate. You require a pair of the coordinate axis to locate the exact position of a point in a plan. The combination of x and y coordinates gets expressed in the form of an ordered pair such as, (x, y). So, the coordinates of a point, say M, can get expressed as, M (x, y). That ordered pair (x, y) gives you the coordinate of the point.
Before you learn to find the distance between two points in 3D, you must know the basic distance formula, which is as below.
Considering two points M [(x_{1}, y_{1})] and N [(x_{2}, y_{2} )] on the given coordinate axis, you can find the distance between them using the formula:
Steps to find the distance between two points:

First, you need to take coordinates of two points like [(x_{1}, y_{1}) and N (x_{2}, y_{2} )].

Then, you have to use the distance formula, which is [sqrt{(x_{2} – x_{1})^{2} + (y_{2} – y_{1})^{2}}].

Now, you have to calculate the vertical and horizontal distance between the two points. The horizontal distance [(x_{2} – x_{1})] represents the points on the xaxis, and the vertical distance [(y_{2} – y_{1})] denotes the points on the yaxis.

Next, you have to square both the values obtained from [(x_{2} – x_{1})] and [(y_{2} – y_{1})].

Now, all you need to do is add both the values, which look like, [(x_{2} – x_{1})^{2} + (y_{2} – y_{1})^{2}].

Finally, you need to find the square root of the obtained value.

The value you get in the end is the distance between two points in the coordinate plane.
Coordinates of A Point
The distance between the two pints can be figured out if one has the coordinates of the two points in the given XY plane. In Euclidean geometry, we often come across points that are positioned in the plane. These points are known to be defined by the coordinates along the x and yaxis. These coordinates are a pair of values that precisely define the location of the point in the given coordinate plane.
Distance Between the Two Points With the Help of the Pythagorean Theorem
Taking the following scenario;
A girl is walking towards the north till 30 meters from where she takes a turn to the east and walks for an additional 40 meters. How can we calculate the shortest between the initial and the final place?
Let us say that the initial point is A while the final point is C. we know that the distance between AB is 30 meters and BC is 40 meters.
Therefore, the shortest distance between the given points A and C is AC. to calculate this distance, we take the help of the Pythagorean theorem, as a result, we get the answer as 50m.
Thus, we have obtained the distance between the starting point to the ending point. In a similar fashion, the distance between two points in a given coordinate plane can also be derived with the help of the Pythagorean theorem or even the right angle theorem formula.
Distance Between Two Points in 3D
The following study can get extended to find out the distance between two points in space. We can determine the distance between two points in 3D using a formula as derived below.
For now, refer to fig. 1. Here, point [ P (x_{1}, y_{1}, z_{1})] and [ Q (x_{2}, y_{2}, z_{2}) ] refer to a system of rectangular axes OX, OY, and OZ.
()
From the points P and Q, you need to draw planes parallel to the coordinate plane. Then, you get a rectangular parallelepiped with PQ as the diagonal.
As you can see in the figure, ∠PAQ is forming a right angle. It enables us to apply the Pythagoras theorem in triangle PAQ.
So, now you get [PQ^{2} = PA^{2} + AQ^{2} …(1) ]
Also note that, in triangle ANQ, ∠ANQ is a right angle. Now, you need to apply the Pythagoras theorem to ΔANQ as well.
Now, you obtain [AQ^{2} = AN^{2} + NQ^{2} …(2)]
From equation (1) and equation (2), you get [PQ^{2} = PA^{2} + NQ^{2} +AN^{2}].
As you know the coordinates of the points P and Q, PA = [(y_{2} – y_{1})], AN = [(x_{2} – x_{1})] and NQ = [(z_{2} – z_{1})].
Hence, [PQ^{2} = (x_{2} – x_{1})^{2} + (y_{2} – y_{1})^{2} + (z_{2} – z_{1})^{2}].
Finally, the formula to obtain the distance between two points in 3D is –
[PQ = sqrt{(x_{2} – x_{1})^{2} + (y_{2} – y_{1})^{2} + (z_{2} – z_{1})^{2}}]
That formula can give you the distance between two points P (x1, y1, z1) and Q (x2, y2, z2) in 3D.
Also note that the distance of any point Q (x, y, z) in space from origin O (0, 0, 0), can get expressed as, [OQ = sqrt{x^{2} + y^{2} + z^{2}}].
Applications
The distance formula has numerous applications in our daytoday life. For instance, the pilot in the plane can use the distance formula to calculate the distance between their plane and any other plane. The first step involved is the finding of the coordinate and then applying the distance formula to get the desired results.
Note
It is to be kept in mind that the distance between two points can never have a negative value. This is because;

Distance is a term that is used to represent how far two points are from one another. And as it is a physical quantity, it can never be negative.

The use of the distance formula conveys that it represents its outcome as the square root of the addition of the two given positive numbers. As we know that the addition of two positive numbers always gives a positive number. 
Even in a case where the distance between the two points equals zero, it is still a nonnegative integer. And thus, the distance between the two points cannot be negative.
Solved Examples

Find the distance between two points given by A (6, 4, 3) and B (2, 8, 3).
Answer: Here, we need to use the distance formula to find the distance between points A and B.
You have, [AB = sqrt{(x_{2} – x_{1})^{2} + (y_{2} – y_{1})^{2} + (z_{2} – z_{1})^{2}}]
[AB = sqrt{(6 – 2)^{2} + (4 – (8)^{2} + (3 3)^{2}}]
[AB = sqrt{16 + 144 + 36}]
Finally, AB = 14; so the distance between points A and B is 14.