The distance between two points is the length of the path connecting them. The shortest path distance is a straight line. In a 3 dimensional plane, the distance between points (X_{1}, Y_{1}, Z_{1}) and (X_{2}, Y_{2}, Z_{2}) are given. The distance between two points on the three dimensions of the xyz-plane can be calculated using the distance formula
For curved or more complicated surfaces, the so-called metric can be used to compute the distance between two points by integration. When unqualified, "the" distance generally means the shortest distance between two points. For example, there are an infinite number of paths between two points on a sphere but, in general, only a single shortest path. The shortest distance between two points is the length of a so-called geodesic between the points. In the case of the sphere, the geodesic is a segment of a great circle containing the two points.
Example:
Calculate the distance between 2 points in 3 dimensions for the given details.
X1 = 2, X2 =7
Y1 = 5, Y2 = 4
Z1 = 3, Z2= 6
Solution:
Apply formula:
d = √ [(x_{2}-x_{1})2 + (y_{2}-y_{1})2 + (z_{2}-z_{1})^{2}]
d = √ [(7-2) ^{2} + (4-5) ^{2} + (6-3)^{ 2}]
d = √ [(5) ^{2} + (-1) ^{2} + (3) ^{2}]
d = √ 25+1+9
d = √35
d = Sqrt 35
d = 5.9160