Kilometers made...
#3

Let's suppose you got a 1 second timer to show the speed to the user.

Save his last speed on the timer. Sum it with the current speed and divide it by 2.

To calculate the speed he traveled in that second you just have to divide the last result with 3600.

1 hour = 60 minutes = 3600 seconds. If he traveled 120 Km in an hour then in 1 second he traveled 0.033 Km. Keep summing it up every time the timer ticks and you got his total km made.
Reply


Messages In This Thread
Kilometers made... - by Fjclip99 - 06.04.2015, 13:04
AW: Kilometers made... - by Mencent - 06.04.2015, 13:25
Re: Kilometers made... - by Kimossab - 06.04.2015, 16:17

Forum Jump:


Users browsing this thread: 1 Guest(s)