- Written By
Uma A V
- Last Modified 25-01-2023
Distance Formula in 3D – Distance Formula in 2D, 3D, Applications, and Examples
Distance Formula in 3D: Knowing the distance between two places is something that we cannot avoid in our daily lives. Mathematically, a similar scenario would have two points to find the distance between them. In a two-dimensional plane, a point is determined by two coordinates, \(x\) and \(y\). Considering the line segment joined by the two points as the hypotenuse of the right triangle got by constructing the legs drawn parallel to the axes, the coordinates of the points can be used to find the distance between them.
When it comes to three-dimensional space, a point is determined by three coordinates \(x, y\), and \(z\). As an extension of the formula to find the distance between two points in the two-dimensional plane, applying the Pythagorean Theorem multiple times, we can derive the distance formula in \(3D\) using the coordinates of the points.
Let the points \(A\left(x_{1}, y_{1}\right)\) and \(B\left(x_{2}, y_{2}\right)\) be two points on a rectangular coordinate plane.
Learn All About Distance Formula
In the right triangle \(A B C\), by the Pythagorean Theorem, \(A B^{2}=A C^{2}+B C^{2}\) or \(A B=\sqrt{A C^{2}+B C^{2}}\).
Points \(A\) and \(C\) have the same \(y\)-coordinates. Similarly, \(B\) and \(C\) have the same \(x\) -coordinates. So:
\(A C=x_{2}-x_{1}\)
\(B C=y_{2}-y_{1}\)
That is, \(A B=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}}\).
Thus, the shortest distance between the two points \(\left(x_{1}, y_{1}\right)\) and \(\left(x_{2}, y_{2}\right)\) is given by the formula:
\(d=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}}\)
In three-dimensional geometry, a point has three coordinates: \(x, y\), and \(z\). The shortest distance between points \(A\left(x_{1}, y_{1}, z_{1}\right)\) and \(B\left(x_{2}, y_{2}, z_{2}\right)\) is the square root of the sum of the squares of the difference between the corresponding coordinates. That is: \(A B=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}+\left(z_{2}-z_{1}\right)^{2}}\)
Let \(A\left(x_{1}, y_{1}, z_{1}\right)\) and \(B\left(x_{2}, y_{2}, z_{2}\right)\) be two points in the rectangular coordinate plane. To derive the formula to find the shortest distance between the two points, consider a parallelepiped with the line segment \(A B\) as a diagonal and the faces parallel to the axes planes.
Here, \(\angle A D B\) is a right angle, so \(\Delta A D B\) it is a right triangle. Then, by the Pythagorean Theorem, \(A B^{2}=A D^{2}+B D^{2}\).
Again, \(\angle A C D\) is a right angle, so \(\triangle A C D\) it is a right triangle. Then, by the Pythagorean Theorem, \(A D^{2}=A C^{2}+C D^{2}\).
Applying the value of \(A D^{2}\) in the first equation, we have \(A B^{2}=A C^{2}+C D^{2}+B D^{2}\).
However, we have:
\(A C=x_{2}-x_{1}\)
\(C D=y_{2}-y_{1}\)
\(B D=z_{2}-z_{1}\)
Substituting these values:
\(A B^{2}=\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}+\left(z_{2}-z_{1}\right)^{2}\)
or
\(A B=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}+\left(z_{2}-z_{1}\right)^{2}}\)
Therefore, the shortest distance between two points \(A\left(x_{1}, y_{1}, z_{1}\right)\) and \(B\left(x_{2}, y_{2}, z_{2}\right)\) is the square root of the sum of the squares of the difference between the corresponding coordinates,
\(A B=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}+\left(z_{2}-z_{1}\right)^{2}}\)
1. To Classify a Triangle as per the Lengths of the Sides:
According to the lengths of the sides, triangles are classified into three – scalene triangles with no equal sides, isosceles triangles with two equal sides and an equilateral triangle with all three sides equal. When the coordinates of the vertices of a triangle are known, the distance formula can be used to find the lengths of the sides. This can further be used to classify the triangles.
That is if a triangle has its vertices at the points \(X\left(x_{1}, y_{1}, z_{1}\right), Y\left(x_{2}, y_{2}, z_{2}\right)\) and \(Z\left(x_{3}, y_{3}, z_{3}\right)\), then the lengths of the sides is calculated as:
\(X Y=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}+\left(z_{2}-z_{1}\right)^{2}}\)
\(Y Z=\sqrt{\left(x_{3}-x_{2}\right)^{2}+\left(y_{3}-y_{2}\right)^{2}+\left(z_{3}-z_{2}\right)^{2}}\)
\(X Z=\sqrt{\left(x_{3}-x_{1}\right)^{2}+\left(y_{3}-y_{1}\right)^{2}+\left(z_{3}-z_{1}\right)^{2}}\)
Further, we can also use the side lengths to classify other polygons.
2. To Prove That a Triangle is Right:
In a right triangle, the Pythagoras theorem holds true. So, when the coordinates of the vertices of a triangle are given, the distance formula can be applied to find the lengths of the side. In a triangle, if the square of one of the sides is equal to the sum of the squares of the other two, then it is a right triangle.
3. To Check Whether a Quadrilateral Is a Parallelogram:
A quadrilateral is a parallelogram if it has two pairs of congruent, opposite sides. So, if the coordinates of the vertices of a quadrilateral in \(3D\) are given, the lengths of the sides can be calculated using the distance formula in \(3D\) to check whether the quadrilateral is a parallelogram.
4. To Check whether a Quadrilateral Is a Square or Rectangle:
A quadrilateral is a rectangle with two pairs of opposite sides that are congruent and congruent diagonals. Similarly, a quadrilateral is a square with all four sides that are congruent and congruent diagonals. Here, the distance formula is useful in finding these lengths to check which shape the coordinates form.
5. Perimeter of Any Polygon:
For a polygon in a three-dimensional plane whose coordinates of vertices are given, the lengths of the sides can be calculated using the distance formula. The sum of these lengths is the perimeter of the polygon.
6. Collinearity of Three Points:
Three points are collinear if they lie on the same line. For any three points on a \(3D\) plane, it is enough to show that the sum of the lengths of two line segments obtained by joining these points is equal to the length of the third line segment. That is, the points \(L\left(x_{1}, y_{1}, z_{1}\right), M\left(x_{2}, y_{2}, z_{2}\right)\) and \(N\left(x_{3}, y_{3}, z_{3}\right)\) are collinear if either \(L M+M N=L N\) or \(L N+N M=L M\) or \(M L+L N=M N\).
Summary
The article defines and derives the distance formula in two-dimensional planes and three-dimensional space. Then it lists the applications such as classifying a triangle according to the lengths of the sides; to check whether a triangle is right-angled; to check whether a quadrilateral is a parallelogram, square, or rectangle; to find the perimeter of a polygon when the coordinates of the vertices of these polygons are given.
Another important application discussed in the article is to check the collinearity of three points. The article concludes with some solved examples for better clarity on the concept and calculations.
Learn All Concepts on Coordinate Geometry
Q.1. What is the shortest distance between \(X(-3,7,8)\) and \(Y(2,-4,9)\) ?
Ans: The shortest distance \(d\) between the points \(P\left(x_{1}, y_{1}, z_{1}\right)\) and \(Q\left(x_{2}, y_{2}, z_{2}\right)\) is given by \(d=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}+\left(z_{2}-z_{1}\right)^{2}}\).
Here, \(\left(x_{1}, y_{1}, z_{1}\right)=(-3,7,8)\) and \(\left(x_{2}, y_{2}, z_{2}\right)=(2,-4,9)\).
So: \(X Y=\sqrt{(2-(-3))^{2}+(-4-7)^{2}+(9-8)^{2}}\)
\(=\sqrt{25+121+1}\)
\(=\sqrt{147}\) units
Q.2. Find the coordinates of the point on the \(x\)-axis that is equidistant from the points \((-1,2,3)\) and \((2,1,-1)\).
Ans: The coordinates of a point on the \(x\)-axis would have a format \((a, 0,0)\).
Given that the distance between \((-1,2,3)\) and \((a, 0,0)\) is the same as that between \((2,1,-1)\) and \((a, 0,0)\).
Using distance formula,
\(\sqrt{(a-(-1))^{2}+(0-2)^{2}+(0-3)^{2}}=\sqrt{(a-2)^{2}+(0-0)^{2}+(0-(-1))^{2}}\)
Squaring both sides,
\((a-(-1))^{2}+(0-2)^{2}+(0-3)^{2}=(a-2)^{2}+(0-0)^{2}+(0-(-1))^{2}\)
Solving for \(a\),
\(a^{2}-2 a+1+4+9=a^{2}-4 a+4+1+1\)
\(-2 a+4 a=6-14\)
\(a=-4\)
Therefore, the required point is \((-4,0,0)\).
Q.3. Show that the points \(J(5,4,2), K(6,2,-1)\) and \(L(8,-2,-7)\) are collinear.
Ans: The three points are collinear if the sum of the lengths of two line segments obtained by joining these points is equal to the length of the third line segment.
Use the distance formula to find the lengths of the line segments.
\(J K=\sqrt{(6-5)^{2}+(2-4)^{2}+(-1-2)^{2}}\)
\(=\sqrt{1+4+9}\)
\(=\sqrt{14}\)
\(K L=\sqrt{(8-6)^{2}+(-2-2)^{2}+(-7-(-1))^{2}}\)
\(=\sqrt{4+16+36}\)
\(=\sqrt{56}\)
\(=2 \sqrt{14}\)
\(J L=\sqrt{ \left.(8-5)^{2}+(-2-4)^{2}+(-7-2)\right)^{2}}\)
\(=\sqrt{9+36+81}\)
\(=\sqrt{126}\)
\(=3 \sqrt{14}\)
\(J K+K L=\sqrt{14}+2 \sqrt{14}\)
\(=3 \sqrt{14}\)
\(=J L\)
Hence proved.
Q.4. Show that the triangle with the coordinates \(X(0,2,0), Y(4,2,0)\) and \(Z(4,2,4)\) is an isosceles right triangle.
Ans: An isosceles triangle has two congruent sides. If the square of one of the sides is equal to the sum of the other two squares, the triangle is a right triangle. A triangle is an isosceles right triangle if it satisfies both.
Use the distance formula to find the lengths of the sides.
\(X Y=\sqrt{(4-0)^{2}+(2-2)^{2}+(0-0)^{2}}\)
\(=\sqrt{16+0+0}\)
\(=4\)
\(\quad Y Z=\sqrt{(4-4)^{2}+(2-2)^{2}+(4-0)^{2}}\)
\(=\sqrt{0+0+16}\)
\(=4\)
\(X Z=\sqrt{(4-0)^{2}+(2-2)^{2}+(4-0)^{2}}\)
\(=\sqrt{16+0+16}\)
\(=\sqrt{32}\)
\(=4 \sqrt{2}\)
Clearly, \(X Z=Y Z\). So, \(\Delta X Y Z\) is an isosceles triangle.
Next:
\(X Y^{2}+Y Z^{2}=4^{2}+4^{2}\)
\(=32\)
\(=X Z^{2}\)
That is, it is also a right triangle.
Therefore, \(∆XYZ\) is an isosceles right triangle.
Q.5. What shape is formed by joining the vertices \(P(-4,2,1), Q(1,2,1), R(1,-3,1)\) and \(S(-4,-3,1)\) ?
Ans: Using distance formula to calculate the length of the sides.
\(P Q=\sqrt{(1-(-4))^{2}+(2-2)^{2}+(1-1)^{2}}\)
\(=\sqrt{25+0+0}\)
\(=5\)
\(Q R=\sqrt{(1-1))^{2}+(-3-2)^{2}+(1-1)^{2}}\)
\(=\sqrt{0+25+0}\)
\(=5\)
\(=R S=\sqrt{(-4-1))^{2}+(-3-(-3))^{2}+(1-1)^{2}}\)
\(=\sqrt{25+0+0}\)
\(=5\)
\(=P S=\sqrt{(-4-(-4))^{2}+(-3-2)^{2}+(1-1)^{2}}\)
\(=\sqrt{25+0+0}\)
\(=5\)
Using distance formula to calculate the length of the diagonals.
\(P R=\sqrt{(1-(-4))^{2}+(-3-2)^{2}+(1-1)^{2}}\)
\(=\sqrt{25+25+0}\)
\(=\sqrt{50}\)
\(Q S=\sqrt{(-4-1)^{2}+(-3-2)^{2}+(1-1)^{2}}\)
\(=\sqrt{25+25+0}\)
\(=\sqrt{50}\)
Since all four sides are congruent and the diagonals are equal in length, quadrilateral \(PQRS\) is a square.
Frequently Asked Questions(FAQs)
Q.1. What is the 3D distance?
Ans: The distance between two points in a three-dimensional space is called the \(3D\) distance. This distance can be calculated using the distance formula in \(3D\).
The distance formula for finding the distance \(d\) between the points \(P\left(x_{1}, y_{1}, z_{1}\right)\) and \(Q\left(x_{2}, y_{2}, z_{2}\right)\) is given by
\(d=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}+\left(z_{2}-z_{1}\right)^{2}}\)
Q.2. What is the distance between two points?
Ans: The distance between two points is the length of the line segment that connects the two given coordinate points. It is calculated by finding the length of the line segment with its endpoints as the given coordinates.
Q.3. How do you calculate the distance formula?
Ans: The distance formula for finding the distance \(d\) between the points \(P\left(x_{1}, y_{1}, z_{1}\right)\) and \(Q\left(x_{2}, y_{2}, z_{2}\right)\) is given by
\(d=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}+\left(z_{2}-z_{1}\right)^{2}}\)
This formula is calculated by considering a parallelepiped with line segment \(\overline{A B}\) as a diagonal and the faces parallel to the coordinate planes.
Q.4. What is an example of a distance formula?
Ans: The distance formula for finding the distance \(d\) between the points \(P\left(x_{1}, y_{1}, z_{1}\right)\) and \(Q\left(x_{2}, y_{2}, z_{2}\right)\) is given by
\(d=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}+\left(z_{2}-z_{1}\right)^{2}}\)
For example, the distance between points \(G(3,0,-7)\) and \(H(-2,6,5)\) is:
\(G H=\sqrt{(-2-3)^{2}+(6-0)^{2}+(5-(-7))^{2}}\)
\(=\sqrt{25+36+144}\)
\(=\sqrt{205}\)
Q.5. What is the last step in the distance formula?
Ans: The formula to find the distance between any two points on a two- or three-dimensional space is called the distance formula.
In two dimensions, the shortest distance between two points \(A\left(x_{1}, y_{1}\right)\) and \(B\left(x_{2}, y_{2}\right)\) is given by the formula:
\(A B=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}}\)
In three-dimensional space, the distance between the points \(X\left(x_{1}, y_{1}, z_{1}\right)\) and \(Y\left(x_{2}, y_{2}, z_{2}\right)\) is given by
\(X Y=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}+\left(z_{2}-z_{1}\right)^{2}}\).
Since it is a length, we only need to consider the non-negative square root in the calculation. So, the last step involved in calculating the distance is taking the positive square root.
We hope this detailed article on the distance formula in 3D helped you in your studies. If you have any doubts, queries or suggestions regarding this article, feel to ask us in the comment section and we will be more than happy to assist you. Happy learning!