# Overlapping circles. Distance to move 1 circle along specific line to remove overlap

I have two lines AB and CD that are not parallel. There is a circle centered on each of points A and C. The circles overlap as the distance between A and C is less than the two radii combined. The circles have the same radius.

To remove the overlap the circle at point C needs to be moved along the line towards D until the distance is greater than the radii of the circles.

I know the distance AC can be worked out which means I'd have:

• the coordinates for both AB and CD
• the distance AC, and the distance the center points need to be away from each other, radii of the circles.

The lines are almost but not quite parallel. Treating them as parallel (I've tried) doesn't produce accurate enough results. I don't know any of the angles.

How do I go from this information to moving the circle in line CD to coordinates on that line where the circles no longer overlap?

$$B$$ doesn't appear in the problem so lets forget about $$B$$. Lets say that for any point $$P$$, $$O_P$$ is the circle at $$P$$ of some fixed radius $$r$$. E.g. $$O_A$$ is the circle at $$A$$, $$O_C$$ is the circle at $$C$$. I'll assume that the situation is set up so that what you're asking for is possible, so I won't try too hard to figure constraints on the problem.

Now say there's a point $$C'$$ on the line $$CD$$ such that the two circles $$O_A$$ and $$O_{C'}$$ kiss; going any further along $$CD$$ means the two circles will separate. Exactly at the point $$C'$$, the distance between $$A$$ and $$C'$$ has to be $$2r$$. Algebraically this is

$$\| A - C' \|^2 = 4r^2$$ where $$\|V\|=\sqrt{V_1^2 + V_2^2}$$ is the Euclidean norm of a vector. We will also use the dot product of two vectors $$V\cdot W := V_1W_1 + V_2W_2$$. Note that $$\|V\|^2=V\cdot V$$.

To determine this point $$C'$$, we will also need to know that $$C'$$ lies on the line $$\vec{CD}$$, which gives a formula if you know the coordinates of $$C,D$$: there is some $$t\in[0,1]$$ such that

$$C' = C + t(D-C)$$ So to find $$C'$$, we just need to find this $$t$$. Plug this into the above:

$$\|A-C - t(D-C)\|^2 = 4r^2$$ this is just a quadratic equation in $$t$$: $$\|A-C\|^2 -4r^2- 2t (A-C)\cdot(D-C) + t^2\|D-C\|^2 = 0$$ For $$a = \|D-C\|^2 , \quad b = -2 (A-C)\cdot(D-C), \quad c = \|A-C\|^2 -4r^2$$ the quadratic formula $$t = \frac{-b\pm \sqrt{b^2-4ac}}{2a}$$ gives

$$t = \frac{(A-C)\cdot(D-C) \pm \left[((A-C)\cdot(D-C))^2-\|D-C\|^2( \|A-C\|^2 -4r^2)\right]^{1/2}}{\|D-C\|^2}$$

Note that $$\|A-C\|<2r$$ (this is the assumption that the two circles $$O_A,O_C$$ intersect), so since we want $$t\in[0,1]$$, in particular $$t\ge 0$$ so we should choose

$$t = \frac{(A-C)\cdot(D-C) + \left[((A-C)\cdot(D-C))^2-\|D-C\|^2( \|A-C\|^2 -4r^2)\right]^{1/2}}{\|D-C\|^2}$$

Or equivalently

$$t = \frac{ \left[((A-C)\cdot(D-C))^2+\|D-C\|^2( 4r^2 +\|A-C\|^2 )\right]^{1/2}+(A-C)\cdot(D-C) }{\|D-C\|^2 }$$

If $$AC$$ and $$DC$$ were orthogonal, then $$(A-C)\cdot(D-C) = 0$$. Then $$t$$ simplifies to $$t=\frac{\sqrt{4r^2 -\|A-C\|^2 }}{\|D-C\| }$$

If $$(A-C)\cdot(D-C)$$ was small, you could try a linear approximation $$t \approx \frac{\sqrt{4r^2 -\|A-C\|^2 }}{\|D-C\| } + \frac{(A-C)\cdot(D-C)}{\|D-C\|^2}$$

In the general case, we have

$$C' = C + \frac{ \left[((A-C)\cdot(D-C))^2+\|D-C\|^2( 4r^2 -\|A-C\|^2 )\right]^{1/2}+(A-C)\cdot(D-C) }{\|D-C\|^2 }(D-C)$$

Angle line of centers makes to $$AC$$ makes to perpendicular is not given, so I assume it as $$\theta$$. Let

$$h= AC \cos \theta$$

Circle C should be moved out so that it is past a situation where there is tangential contact of $$(A,Q)$$ centered circles.The shift should be equal or more than

$$PQ =\sqrt{4R^2-h^2}$$

• The circles are not given to be congruent, so $AQ=r_1+r_2$. Otherwise this approach is good, though I would let $\theta=\angle ACD$ then use sine rule to find $CQ$ Oct 28, 2019 at 9:53
• @DanielMathias this is the approach I took. The above answer works but after finding PQ, CP also needs to be found (unless I misunderstand) Oct 28, 2019 at 10:47
• @DanielMathias OP has given circles of same radius. Oct 28, 2019 at 10:58
• @Narasimham Thanks for your answer but I don't quite understand. I used tan 𝜃 = m2−m1/1+m1m2 to get angle ACD and then I had two side lengths and one angle and used SSA and sine law to get the rest. I'm not sure how to establish h or 𝜃 without doing the same. Oct 28, 2019 at 11:24
• Selective vision... Anyway, we still need to find $CQ$ rather than $PQ$ Oct 28, 2019 at 11:53