Measuring the distance