How about the law of cosines?
Consider the following triangle $\triangle ABC$, the $ \color{maroon} {\text{poly 1}}$ below, with sides $\color{maroon}{\overline{AB}=c}$ and $\color{maroon}{\overline{AC}=b}$ known. Further the angle between them, $\color{green}\alpha$ is known.
$\hskip{2 in}$
Then, the law of cosines tell you that $$\color{maroon}{a^2=b^2+c^2-2bc\;\cos }\color{blue}{\alpha}$$
The angular displacement between $A$ and $C$ is $a_2 - a_1$, therefore, the minimum (perpendicular )distance from the origin to line $AC$ is given by
$d_1 = r_1 \cos \dfrac{(a_2 - a_1)}{2} $
similarly the minimum (perpendicular) distance from the origin to $BD$ is given by
$d_2 = r_2 \cos \dfrac{(a_2 - a_1)}{2} $
Hence the distance between the two lines is
$d = d_2 - d_1 = (r_2 - r_1) \cos \dfrac{(a_2 - a_1)}{2} $
For the second part, point $B'$ is given by
$B' = r_2 (\cos \phi, \sin \phi ) = A + t (C - A) $
Since the distance of $B'$ from the origin is $r_2$, then $t$ must be the root of the following equation:
$\mathbf{A} \cdot \mathbf{A} + 2 t \mathbf{A} \cdot (\mathbf{C}-\mathbf{A}) + t^2 (\mathbf{C} - \mathbf{A}) \cdot (\mathbf{C} - \mathbf{A}) = r_2 ^2$
All the quantities can be computed, and the quadratic equation in $t$ can be solved using the quadratic formula resulting in two values of $t$ corresponding to point $B'$ and $D'$. The negative value of $t$ corresponds to $B'$ and the positive value corresponds to $D'$. To find the angles just use the $\text{ATAN2}$ function, so that
$\phi_{\text{B'}} = \text{ATAN2}( B'_x , B'_y)$
$\phi_{\text{D'}} = \text{ATAN2}( D'_x , D'_y)$
Best Answer
Using the law of sines you easily get $$d= \sqrt 2 r \sqrt {1 - \cos x}$$
where d is the hypotenuse of your yellow triangle.