Solution (source code)

= Solution

Call the centre of the <circle> $O$, the left endpoint on the diameter $A$, the point of tangency $T$, and the external intersection $E$. Since $OA=OT$ are <radii>, the <isosceles triangle> $AOT$ has equal base <angles>: $\angle OAT=\angle ATO=30^\circ$. Therefore $\angle AOT=120^\circ$, and, because $OA$ and $OE$ point in opposite directions, $\angle TOE=60^\circ$. The <tangent to a circle> $TE$ is perpendicular to the <radius> $OT$, so in the right <triangle> $OTE$,
$$
\boxed{\theta=180^\circ-90^\circ-60^\circ=30^\circ.}
$$