Added helper math functions for time and distance.