# Find the coordinates of the points on the segment connecting two circles

I have two circles, their centers are connected by a segment. I would like to find the coordinates of the points that lies on the segment on a specified distance from the edge of the circle.

Here is the picture:

The parametric equation for the line from $(x_1,y_1)$ to $(x_2,y_2)$ is

$$P(t)=(x_1,y_1)+t(x_2-x_1,y_2-y_1)$$

then let indicate with $d$ the distance from $(x_1,y_1)$ to $(x_2,y_2)$ that is

$$d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}$$

and with

• $t_1=\frac{r+a}{d}$

• $t_2=\frac{d-(r+a)}{d}$

then

• $(u_1,v_1)=P(t_1)$
• $(u_2,v_2)=P(t_2)$