I am trying to write a function, tanCircles[], that finds the common tangents to two given circles (one not inside the other). The function's parameters are two list, each containing the x and y coordinates of the center and the radius. If one circle is inside the other, the function should return an error message. Otherwise, the function should return the equations of all tangents found. This is what I have tried but doesn't seem to be right.
Block[{t1, t2, v1, v2, pts}, t1 = {xm, ym};
t2 = {xn, yn};
{v1, v2} = p[];
pts = {t1, t2} /.
NSolve[{(t2 - v2) . (t2 - t1) == 0, (t1 - v1) . (t2 - t1) ==
0, (t1 - v1) . (t1 - v1) == r1^2, (t2 - v2) . (t2 - v2) ==
r2^2, (t1 - v1) . (t2 - v2) > 0}, {xm, ym, xn, yn}, Reals];
