Calculates distance in kilometers