# Measuring the Hypotenuse

Robots can use distance sensors to determine where objects or people are in the environment. A stationary distance sensor can only measure the distance to an object right in front of it. On the other hand, a moving distance sensor can measure the distance to a number of objects in the environment. It can even compute the distance between these objects.

In this project, students are challenged to design a system to measure the distance between points A and B using a distance sensor at a third point C. The distances CA and CB can change, but the angle ACB is always a right angle.

The system shown in the video below includes a distance sensor mounted on a servo motor. Cardboard surfaces are placed at A and B. The servo motor rotates the sensor to measure the distance to each cardboard surface. The program then uses the Pythagorean Theorem to compute the distance between A and B. This distance is displayed on the screen. The cardboard surfaces at A and B can be moved to accommodate different lengths for CA and CB.