Drive time calculation given speed and distance

24 Views Asked by At

Building a routing application and I am running into an elementary problem with my drive time calculations.

I know the formula for drive time is: Time = Distance / Speed

I have the distance and speed. I am running these calculations in SQL. For this example the length in miles is 1.090319679181873 and the mph is 81.

If I plug these numbers into the above equation 1.090319679181873/81 this yields 0.013460737

Now I found an example online where somebody modified the calculation to this 1.090319679181873/(81/60) and this yields 0.8076442068013874 this does seem more correct that a car traveling at 81 MPH will take .8 of a minute to drive a little over 1 mile.

I am just trying to understand why I had to divide the MPH by 60

1

There are 1 best solutions below

0
On BEST ANSWER

Well, MPH stands for miles per hour, so when you divide the distance in miles by a speed in mph you get time in hours. So, you got an answer of about $0.0135$ hours, which we can multiply by the number of minutes per each hour ($60$) to get $0.0135 \text{ hours} \cdot 60 \frac{\text{minutes}}{\text{hour}} = 0.81 \text{ minutes},$ the same as the other answer. (with some rounding to keep numbers neat)

The given answer is just first converting the speed from miles per hour into miles per minute, which we do by dividing by $60$: intuitively we can justify this because if a minute is $60$ times smaller than an hour, then we go $\frac{1}{60}$ as far per minute as we do per hour. In any case, dividing by something that's been divided by $60$ is the same as multiplying by $60$ at the end so the two methods are equivalent.

Moral of the story: take care of your units and they'll take care of you.