How To Calculate The Distance Between Two Coordinates

Knowing how to calculate distance between two coordinates has many practical applications in science and construction. To find the distance between two points on a 2-dimensional grid, you need to know the x- and y-coordinates of each point. To find the distance between two points in 3-dimensional space, you need to know the z-coordinates of the points as well.

Advertisement

The distance formula is used to handle this job and is straightforward: Take the difference between the X-values and the difference between the Y-values, add the squares of these, and take the square root of the sum to find the straight-line distance, as in the distance between two points on Google maps over the ground rather than on a winding road or waterway.

Distance in Two Dimensions

Step 1

Calculate the positive difference between the x-coordinates and call this number X. The x-coordinates are the first numbers in each set of coordinates. For example, if the two points have coordinates (-3, 7) and (1, 2), then the difference between -3 and 1 is 4, and so X = 4.

Advertisement

Step 2

Calculate the positive difference between the y-coordinates and call this number Y. The y-coordinates are the second numbers in each set of coordinates. For example, if the two points have coordinates (-3, 7) and (1, 2), then the difference between 7 and 2 is 5, and so Y = 5.

Step 3

Use the formula

\(D^2=X^2+Y^2\)

to find the squared distance between two points. For example, if X = 4 and Y = 5, then

\(D^2=4^2+5^2=41\)

Thus, the square of the distance between the coordinates is 41.

Step 4

Take the square root of D2 to find D, the actual distance between the two points. For example, if D2 = 41, then D = 6.403, and so the distance between (-3, 7) and (1, 2) is 6.403.

Distance in Three Dimensions

Step 1

Calculate the positive difference between the z-coordinates and call this number Z. The z-coordinates are the third numbers in each set of coordinates. For example, suppose two points in three-dimensional space have coordinates (-3, 7, 10) and (1, 2, 0). The difference between 10 and 0 is 10, and so Z = 10.

Advertisement

Step 2

Use the formula

\(D^2=X^2+Y^2+Z^2\)

to find the squared distance between two points in three-dimensional space. For example, if X = 4, Y = 5, and Z = 10, then

\(D^2=4^2+5^2+10^2=141\)

Thus, the square of the distance between the coordinates is 141.

Step 3

Take the square root of D2 to find D, the actual distance between the two points. For example, if D2 = 141, then D = 11.874, and so the distance between (-3, 7, 10) and (1, 2, 0) is 11.87.

Cite This Article

MLA

Langdon, Nucreisha. "How To Calculate The Distance Between Two Coordinates" sciencing.com, https://www.sciencing.com/calculate-distance-between-two-coordinates-6390158/. 15 December 2020.

APA

Langdon, Nucreisha. (2020, December 15). How To Calculate The Distance Between Two Coordinates. sciencing.com. Retrieved from https://www.sciencing.com/calculate-distance-between-two-coordinates-6390158/

Chicago

Langdon, Nucreisha. How To Calculate The Distance Between Two Coordinates last modified August 30, 2022. https://www.sciencing.com/calculate-distance-between-two-coordinates-6390158/

Recommended

Advertisement