I have a programming problem. I need to find the intersection points between two lines tangent to two circles and the circles! I have the circles' radiuses and centers.

So I need points V1, V2, V3 and V4, and I have centers X1, X2 and radiuses R1 and R2.
Let be $X_1$ the center point of first circle $X_2$ of the second. $V_1$ the intersection point on the first circle $V_3$ of the second. $d$ the distance between $X_1$ and $X_2$. $r_i$ the radii. The angle $\alpha$ between $V_1X_1X_2$ is given by $\cos\alpha=\frac{R_1-R_2}{d} $ Thus $V_1$ is given by $X_1 + R_1*\hat e_\alpha$ where $e_\alpha$ points in the direction $\alpha$ right of $d$