# Create region from polygons and tangential line segments

I have two circles and tangential line segments that I want to define a region:

center1={0,0};
center2={8,0};
endpoint1={x1,y1};
endpoint2={x2,y2};
tangent={endpoint1,endpoint2}/.Solve[{
(endpoint2-center2).(endpoint2-endpoint1)==0,
(endpoint1-center1).(endpoint2-endpoint1)==0,
(endpoint1-center1).(endpoint2-center2)>0},
{x1,y1,x2,y2},Reals]
Graphics[{circle1,circle2, Line[tangent]}]


How can I delete the inner arcs of the circles and create a region that is bounded by the outer lines and arcs of the shape?

I have Mathematica 10.1 so I can use the latest functions in Geometry.

ConvexHullMesh[
Flatten[Table[{4 (a = {Cos[t], Sin[t]}), {8, 0} + 3 a},
{t, 0, 2 π, 0.1}], 1]]


I would suggest using Disk instead of Circle as a start; the following generates a Region object that should generate what you are looking for:

center1 = {0, 0};
center2 = {8, 0};

endpoint1 = {x1, y1};
endpoint2 = {x2, y2};

tangent = {endpoint1, endpoint2} /.
Solve[{(endpoint2 - center2).(endpoint2 - endpoint1) ==
0, (endpoint1 - center1).(endpoint2 - endpoint1) ==
0, (endpoint1 - center1).(endpoint1 - center1) ==
radius1^2, (endpoint2 - center2).(endpoint2 - center2) ==
radius2^2, (endpoint1 - center1).(endpoint2 - center2) >
0}, {x1, y1, x2, y2}, Reals];

points = Flatten[tangent, 1];

RegionPlot[
RegionUnion[
circle1, circle2,
Polygon@points[[First@Rest@FindShortestTour@points]]
],
AspectRatio -> Automatic
]


• MarcoB: How would you "know" where the intersection points are? – David G. Stork Aug 13 '15 at 0:19
• @David Quite. I I misread the question. Thanks for pointing that out; I removed that part. – MarcoB Aug 13 '15 at 0:32

I have found a simple solution which is to compute the outer circular arcs and use the arcs instead of the circles:

angle1 = ArcTan[tangent[[1, 1, 2]]/tangent[[1, 1, 1]]];
angle2 = ArcTan[tangent[[2, 1, 2]]/tangent[[2, 1, 1]]];
arc1 = Circle[center1, radius1, { -1 angle1, 2 π + angle1}];
arc2 = Circle[center2, radius2, { -1 angle2, angle2}];