
8.9 Circles through a Point and Tangent to a Circle with a Given Radius 305
center[3].x = -(l1.b * (l0.c - discrm0) - l0.b * (l1.c - discrm1)) * invDenom;
center[3].y = -(l1.a * (l0.c + discrm0) - l0.a * (l1.c + discrm1)) * invDenom;
}
8.9 Circles through a Point and Tangent
to a Circle with a Given Radius
Given a circle C
0
: {C
0
, r
0
} and a point P , the problem is to find a circle C
1
: {C
1
, r
1
},
with a given radius, that passes through the point and is tangent to the given circle
(see Figure 8.17). As is typical with problems involving tangents, there are, in general,
two solutions. If P is further from C
0
than r
0
+ 2r, or closer than r
0
− 2r, then no
solution is possible. Depending on the relative sizes of the circles, and the placement
of P , one of the circles may be contained within the other—and of course, there may
be four solutions, two solutions, or no solutions (see Figure 8.18). This particular
problem is interesting because it can be solved in (at least) two entirely different
ways—one more analytical and one more constructive.
The more analytical approach is based on the fact that we know the lengths of the
sides of the triangle (P , C
0
, C
1
) (see Figure 8.19). Clearly, if circle C
0
is tangent to C
1
,
then C
1
− C
0
=r
0
+ r
1
. The given point P is on the circle, and so P −C
1
=r
1
.
Finally, both P and C
0
are given. Note that this approach works even when P is
actually on circle C
0
, in which case the triangle degenerates to a line.
To reduce calls to the square root function, we can instead consider the squared
distances. To further simplify the equations, we can translate the system so that one of
the points is at the origin, then solve it, and translate the solution back; we arbitrarily
choose to translate P to the origin. This yields a system of two equations in two
unknowns {C
1,x
, C
1,y
}
P
C
0
r
0
C
1
r
1
Figure 8.17
Circles through a point and tangent to a circle with a given radius.