When the total distance is L and we divide it into N equally length segments, then the average velocity is:
(The not equally distributed case is complicated.)
So the velocity should be calculated at every foot for example and multiplicative inverse (1/v) added up.