A seemingly simple geometry problem that is surprisingly difficult. I want to find the radius of a circle that is tangent to the $x$-axis, but also must contain two given points. I understand there are many situations that have no solution, but for those that do have a solution, how can I find it?
For the image below, the circle origin is at $(d_s, R_0)$, the first point is at $(0,h_s)$, and the second point is at $(d,h_r)$. For valid solutions, $h_s$, $h_r$, and $d$ must all be less than $R_0$. The known quantities are $h_s$, $h_r$, and $d$, and the unknowns are $R_0$ and $d_s$.

An analytical solution: The midpoint of the two points is $(\frac{d}{2}, \frac{h_s+h_r}{2})$, so the equation of their perpendicular bisector is
$$ y-\frac{h_s+h_r}{2} = \frac{d}{h_s-h_r} \left(x-\frac{d}{2}\right) $$
The center must lie on that bisector. It must also be equidistant from the $x$-axis and the given point on the $y$-axis:
$$ y^2 = x^2 + (y-h_s)^2 $$
which yields
$$ y = \frac{x^2+h_s^2}{2h_s} $$
Substitution into the bisector equation gives us
$$ \frac{x^2+h_s^2}{2h_s}-\frac{h_s+h_r}{2} = \frac{d}{h_s-h_r} \left(x-\frac{d}{2}\right) $$
Multiply both sides by $2h_s(h_s-h_r)$ to get
$$ (x^2+h_s^2)(h_s-h_r)-h_s(h_s^2-h_r^2) = dh_s(2x-d) $$
or
$$ (h_s-h_r)x^2 - 2dh_sx + d^2h_s-h_rh_s(h_s-h_r) = 0 $$
which yields
$$ d_s = x = \frac{dh_s \pm \sqrt{d^2h_s^2-(h_s-h_r)[d^2h_s-h_rh_s(h_s-h_r)]}}{h_s-h_r} $$
When there are two solutions, one is "between" the two points, and the other is "on the outside", on the side of the "lower" point. And then the radius $R_0$ is given by
$$ R_0 = y = \frac{d}{h_s-h_r} \left(x-\frac{d}{2}\right) + \frac{h_s+h_r}{2} $$
ETA: It seems much less messy in any individual scenario with specific values for $d, h_s, h_r$.