Let a circle with center $b$ and radius $r$ be contained in a circle with center $a$ and radius $R$.

Given a point $c$ on the small circle, find its distance to the greater circle.
That is find the length of $cd$.
Assume
- the length $ab$, $r$ and $R$ are known,
- the $\mathbb R^2$ coordinates of $a$, $b$ and $c$ are known.
Using the dot product, I can find the angle $abc$.
But, then the cosine law does not uniquely determined the length $bd$.
$$
r + cd = \left(ab\right) \cos abc \pm \sqrt{R^2 - \left(ab\right)^2 \sin^2 abc}.
$$
Is there a way to uniquely determine $cd$?
Hint: The minimum (and maximum) distance between a point on the smaller circle and the closest (and farthest) point on the larger circle occurs when the tangent planes to each point on both circles are parallel. You can use Lagrange multipliers to show this but there may be simpler ways.