In 2D space, I have a point $P$ at $(P_x, P_y)$ and two circles A and B with centers $(A_x, A_y)$ and $(B_x, B_y)$ and radii $A_r$ and $B_r$. I want to find the smallest circle $C$ that fully contains $P$, $A$ and $B$.
Of course, the difficulty lies only in finding the center; the radius can then be obtained trivially.
It seems like super simple geometry, but I'm having difficulties finding a solution. One problem is that there are different cases: $C$ does not necessarily have to touch $P$, $A$ and $B$. It could be touching only two, or even be equal to $A$ or $B$ (tho that case is easy to check for separately).