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

45 Views Asked by At

Could someone please help me out with the trivial problem.

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:

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

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)$