Distance is an important concept both in mathematics and the real world. Of course, measuring real-world distances is typically easier than distances in math; all that you have to do is use a tool like a ruler or odometer to get the actual distance measurement. Given that scales can vary, however, the same technique won't work when measuring distances mathematically. The formula used to calculate distance depends on whether you're measuring distance over time or a distance between two points on a plane.

## Distance Over Time

If you need to calculate the distance between two locations while traveling, this means you're calculating distance over time. The calculation assumes that you're moving at a constant rate and that your movement will occur over a set period of time. If you know these two elements, the distance traveled over that period of time is simply a matter of multiplying the two.

## Distance Over Time Formula

The formula to calculate distance over a period of time is :

To give an example of this, if you're traveling 60 miles per hour (mph) and drive for two and a half hours (2.5 h), you can calculate the distance traveled as:

This gives a total distance of 150 miles (since miles per hour is essentially a fraction of ^{m}/_{h} and hours can be shown as a fraction of ^{h}/_{1}, the two time factors cancel out and leave only miles). You can also use this formula to calculate rate or time as needed, transforming it to:

for whichever calculation you need.

## Distance Between Points

If you're working on a two-dimensional graph, the distance formula is a bit different. Since neither time nor rate are involved in static graphs, you'll instead need to calculate the distance between two points based on their x and y coordinates. The formula here is actually based on the Pythagorean Theorem, as you're essentially calculating one side of a triangle based on its two corner points. You'll take the differences between the x coordinates and between the y coordinates, then square those results and add them. The square root of your final result is the distance between those points.

## Distance Between Points Formula

The formula for this calculation is:

where the first point is represented by (x_{1},y_{1}), and the second point is represented by (x_{2},y_{2}). To give an example, say you're trying to find the distance between the points (1,3) and (4,4). Putting those numbers in the formula, you have:

The distance ends up being √10, which works out to around 3.16.

References

About the Author

Holding a BS in computer science and several years of experience building, repairing and maintaining computers and electronics, Jack Gerard has had a love of science and mathematics for years. When not working on writing projects as part of his 15+ year career, he also works as a programmer writing gaming and accessibility software.