Method and source check
Last checked:
Automated source and implementation review, including worked examples and documented numerical limits. This review does not provide professional advice or specialist approval.
Method
Divide total distance by positive elapsed time, convert speed units, and calculate reciprocal time per unit distance.
average speed = total distance / total time
pace = time / distance
Variables and units
- distance
- positive total path distance in selected unit
- time
- positive elapsed time in selected unit
- speed
- distance per time
- pace
- time per unit distance
Worked example
10km in 1h is 10km/h and 6min/km.
Limitations
Speed and reciprocal pace retain floating-point precision; speed UI displays up to six significant digits and pace UI rounds total seconds once with a carry.
- Average speed uses total distance and elapsed time; it does not describe instantaneous speed or signed average velocity.
- Unsupported derived numerical ranges are rejected with a localized error on a visible form field; the calculations use floating-point arithmetic.
- 10km/1h β 10km/h
- 1mi/1h β about 1mph
- 0.001m/1h β positive speed, not 0