Gauging the Sun's distance with a quadbox

A quadbox is a big box with a hole on the top lid for letting the Sun shine through and two holes on the sides for sighting the Moon when at about First or Last Quarter. The bright dot here represents the spot where the sunbeam lands on the bottom of the box. Dividing the height of the box by the gap between this dot and the quadrature line (or quadline) will give an approximation to the ratio of the Moon's distance to the Sun's distance. Aristarchos might have used this method in the 3c BC to find his lower bound for this ratio; namely, a number between 18 and 20. Notice that it doesn't matter whether the Moon is passed quadrature or not; that is, it doesn't matter whether the bright dot is one side of the quadline or the other. This is because distances (or gaps) are never negative. Drag the bright dot around to see how the resulting gap produces a ratio S.