Astronomers used this very technique to determine the topography of the moon, which was critical in being able to safely land the Eagle on the moon in 1969. Measuring the size of the shadows is fairly straightforward. Figure 1 shows you a schematic diagram of the moon. The sunlight is coming from the right side of the picture. M is the location of some mountain on the moon.
T is the location of the terminator.
And O is the center of the moon. Since the light is coming from the right, you can imagine horizontal lines representing sun rays. Thus, if you extend a horizontal line from the top of the mountain to the left, the place it hits the surface of the moon is where the end of the shadow will be. Figure 1 Figure 2 shows this more explicitly. Now the geometry.