Measurement of height or distance