I am in the middle of a vehicle tracking project where I have to calculate the distance traveled by the vehicle in a given amount of time.
Data I am getting:
Speed : 30.2 km/hr 12.7 km/hr 15 km/hr 21.8 km/hr
Time : 11:00:00 11:00:22 11:00:45 11:01:10
That is I am getting the speed of the vehicle every 20-25 seconds. So what is the best way to calculate the distance traveled by the vehicle during this whole duration? Is taking the median of two speeds the best way to calculate the average speed here?
You have multiple possibilities at hand here.
1
I'd suggest doing some curve fitting to polynomials or just computing the ($3$-rd degree) interpolation polynomial $$v(t) = at^3 + bt^2 + ct + d$$ Then you want to compute $$d = \int_{11:00:00}^{11:01:10} v(t) dt$$
2 Interpolating linearly between the time intervals. This results in a non-smooth velocity curve (which is physically impossible), but requires the least amount of computation.