Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!eos!jbm From: jbm@eos.UUCP (Jeffrey Mulligan) Newsgroups: comp.graphics Subject: Re: Tangents to three circles (SPOILER) Message-ID: <4826@eos.UUCP> Date: 23 Aug 89 19:33:42 GMT References: <11391@polya.Stanford.EDU> <3828@internal.Apple.COM> Organization: NASA Ames Research Center, California Lines: 58 OK, how about this: First consider the case of just two tangent circles: circle X with radius r, and circle A with radius a. Let d be the distance between the centers. There are 3 cases: 1. A is inside of X: r = d + a 2. X is inside of A: r = a - d 3. A and X are externally tangent: r = d - a Now we impose the condition that circle X must be tangent to a second circle B with radius b. We will rename the distance between the centers of X and A (previously "d") "da", and call the distance between the centers of X and B "db". Now we can write down the same 3 cases for B and X, and equate r's for A and B, for a total of nine cases: 1 (1,1) da + a = db + b da - db = b - a 2 (1,2) da + a = b - db da + db = b - a 3 (1,3) da + a = db - b da - db = -(a + b) 4 (2,1) a - da = db + b da + db = a - b 5 (2,2) a - da = b - db da - db = a - b 6 (2,3) a - da = db - b da + db = a + b 7 (3,1) da - a = db + b da - db = a + b 8 (3,2) da - a = b - db da + db = a + b 9 (3,3) da - a = db - b da - db = a - b We can group these cases: I 6,8 da + db = a + b ellipse II 2,4 da + db = | a - b | ellipse III 1,5,9 da - db = +- ( a - b ) hyperbola IV 3,7 da - db = +- ( a + b ) hyperbola These are all conics having foci at the centers of A and B. For any point on one of these curves, there is a corresponding r for which the circle centered at the chosen point with radius r will be tangent to A and B. Note that for the case of A and B concentric that da=db regardless of r, so there are no solutions to cases III and IV (well, unless a==b). Now if we add a third circle C, we get four more conic sections (defined bewteen A and C or B and C). Any intersections between the new four and the original four should correspond to valid solutions. It is left as an exercise to the reader to show that the max. number of solutions is 9 or whatever it is. -- Jeff Mulligan (jbm@aurora.arc.nasa.gov) NASA/Ames Research Ctr., Mail Stop 239-3, Moffet Field CA, 94035 (415) 694-6290