Thread: Circle-Cirlce tangent in three dimensions

1. Circle-Cirlce tangent in three dimensions

My problem is to find two circles in 3D space that share a tangent vector. The only thing known is a a point and tangent on each circle and the radius for both circles.

The problem can be visualized with this image/video:

Known:
$P_a$ - Point on Circle A
$\vec{B_a}$- Circle tangent at point Pa, normalized
$R_a$ - Radius of Circle A
$P_b$ - Point on Circle B
$\vec{B_b}$- Circle tangent at point Pb, normalized
$R_b$ - Radius of Circle B

Wanted:
$D_a$ - Circle-Circle tangent point on Circle A
$D_b$ - Circle-Circle tangent point on Circle B

We know the following:
$(C_a-D_a)\cdot(D_b-D_a) = 0$
$(C_b-D_b)\cdot(D_b-D_a) = 0$
$(C_a-P_a)\cdot\vec{B_a} = 0$
$(C_b-P_b)\cdot\vec{B_b} = 0$
$|C_a-P_a|=|C_a-D_a|=R_a$
$|C_b-P_b|=|C_b-D_b|=R_b$
$(C_a-D_a)\cdot(C_b-D_b) = R_a*R_b*\cos{\alpha}$
$\alpha$ - is the angle(unknown) between the Circle A and Circle B plane

I have tried to solve this by substitution but it gets messy. I'm happy for any suggestion in how to find an analytic solution. Maybe I have missed some geometric relations that could help to find a solution?

Here is some relations that could be used.

There is a relation between the given circle tangents and the wanted circle-circle tangent which gives:
Circle A:
$(D_a-P_a)\cdot(D_a-D_b) = |D_a-P_a|*|D_a-D_b|*\cos{\beta}$
$(D_a-P_a)\cdot{B_a} = |D_a-P_a|*\cos{\beta}$
This gives:
$|D_a-D_b| = \frac{(D_a-P_a)\cdot(D_a-D_b)}{(D_a-P_a)\cdot{B_a}}$
Doing same thing for Circle B gives:
$|D_a-D_b| = \frac{(D_b-P_b)\cdot(D_a-D_b)}{(D_b-P_b)\cdot{B_b}}$
Combining this gives:
$(D_a-P_a)\cdot(D_a-D_b)*(D_b-P_b)\cdot{B_b} = (D_b-P_b)\cdot(D_a-D_b)*(D_a-P_a)\cdot{B_a}$