Need help with a math problem (very embarrassing question)

Soldato
Joined
18 Aug 2006
Posts
10,053
Location
ChCh, NZ
I'm writing a little program for my iPhone where it calculates the miles per hour I've walked/ran over a certain distance. So for instance, If I dashed the 200m in 27 seconds, what would my average miles per hour be. I cannot believe that I cannot find the mathematical formula to work this out.
My brain suddenly went blank and it would've came to me eventually through the evening but I want to knock up the program tonight hence the fact embarrassing myself publicly :o:o:o

Lastly, yes, I know there is many programs out there that does this but I want to do it for fun anyway.
 
This needs to be solved in two stages otherwise you're going to get confused and write very messy code. Firstly you need to deal in the same units, in this case you're better off working in kilometres and hours instead of seconds or minutes.

So 0.2 km in 0.0075 hours. You then divide the distance by the hours to get a figure for how far you'd travel in an hour = 26.7km/h. Convert this to miles if you want mph.
 
This needs to be solved in two stages otherwise you're going to get confused and write very messy code. Firstly you need to deal in the same units, in this case you're better off working in kilometres and hours instead of seconds or minutes.

So 0.2 km in 0.0075 hours. You then divide the distance by the hours to get a figure for how far you'd travel in an hour = 26.7km/h. Convert this to miles if you want mph.

Nice one mate. I tried calculating without converting to the same units which made it an interesting mind ****. Got it now, cheers for that.
 
Back
Top Bottom