If $$x$$ is the diameter of the Moon and $$R$$ its distance, then according to Aristarchus, the width ED of the shadow at distance $$R$$ equals $$2x$$ (actually, $$2.5x$$ comes closer to the mark). We add to the drawing points H and K so that HA = KD = $$x$$.
The width of the Moon as seen from point H is KD = $$x$$, and since the Moon's size in the sky is about the same as the Sun's, the angle KHD (shaded) should also equal 0.5 degrees. We now extend the line AD = R a further distance R to point F. Then the two shaded triangles HKD and KFD are congruent (= same in size and shape) and have the same 0.5 angle as the angle at C. Indeed, one can prove now that the triangles GFC and AHD are also congruent to the two shaded ones.
It follows then that AC = $$3R$$, and from simple proportions (see drawing) $$AB\,=\,3x$$.