PDA

Click to See Complete Forum and Search --> : Center of a circle tangent to other two circles


Helder Barros
Dec 8th, 2005, 05:48 PM
I need to find the center circle with a radius R3, tangent to other two circles with radius R1 and R2 and centers X1, Y1 and X2,Y2.

Any help? Thanks in avance!

opus
Dec 9th, 2005, 10:05 AM
The way to do it:

You have X1, Y1 and X2,Y2, calculate the direction and distance from circle1 to circle2 using the differences (X2-X1) and (Y2-Y1). Having the direction, start at point X1,Y2 a go along the direction for Radius1, you get TangentPoint1. Using the direction and Distance(Circle1 to Circle2) -Radius2, you get TangentPoint2.
The distance between TangentPoint1 and 2 will give you the diameter of your new circle, and thecenter point is halfway between the tangents.

for the actual calculation use whichever method you like, just remember "old phythagoras" !

zaza
Dec 9th, 2005, 04:31 PM
Hm, I can't comment on what opus said, mainly because I don't understand it. I'll try to explain my thoughts:

Imagine lines drawn to join the centre points of the 3 circles. These will necessarily go through the tangent points. The third circle can be as big or as small as you like, there is no restriction but it will affect the position of (X3,Y3) obviously.

So, you have a triangle with corners at the centres of the circles. Hence the 3 sides must be (R1+R2), (R1+R3), (R2+R3).
Hence, using the cosine rule: a^2 = b^2 + c^2 - 2bc cosA, where A is the angle opposite side A, you can get an expression for cosA, and hence A, in terms of the sides. CosA tells you the direction of (X3,Y3) relative to the centre of another circle, say (X1,Y1). And the distance is (R1+R3). The angle A is relative to the line joining (X1,Y1) to (X2,Y2) rather than the horizontal, hence you need to account for this before you find the coords. Total angle B to horizontal is A + arctan(Y2-Y1 / X2-X1) and you can then just say that X3 = X1+(R1+R3)cosB and Y3 = Y1+(R1+R3)sinB.

Try drawing the circles and the triangle, then go from there.

zaza