Michael Penn recently discussed this classic problem in his channel with very straightforward Cartesian coordinates method. You need to find a small disk simultaneously tangent to two quarter circles and a side of square. I think this is an excellent example of practicing circle inversion and to show a useful case of ResourceFunction["CircleInversion"] in WFR.
Choose inversion center
Choose inversion center
If you want to refresh you knowledge about how circle inversion works, please refer to Applications and Neat Examples in the documentation of CircleInversion function.
In Apollonian gasket-like problem, it is a common practice to choose the inversion center at some contacts. Usually the radius of the inversion circle is flexible, I set it to the distance between the circle-circle contact point and (1,0). This is gives a nice concurrency in the diagram:
inversionCenter=Circle1
2
,12
,2*Sin[π/8];invfunc[obj_]:=ResourceFunction["CircleInversion"][inversionCenter,obj]The two quarter circles and the vertical line passing (1,1) and (1,0):
In[]:=
items=Circle[{0,0},1],Circle[{1,1},
2
-1],InfiniteLine[{{1,0},{1,1}}];Invert everything above with respect to the inversion center:
inv=FullSimplify@Quiet@(invfunc/@items)
Out[]=
InfiniteLine,,,-,InfiniteLine+,+,-,,Circle1+,,1
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
Everything with the same color are inversion of each other with respect to the dashed circle: circle centered at (0,0) is inverted to line passing (0,1) and (1,0) circle centered at (1,1) is inverted to line passing and line passing (1,0) and (1,1) is inverted to circle centered and vice versa. With my choice of inversion radius,
(0,1+
2
)(1+
2
,0)1+,
1
2
1
2
g1=Graphics{EdgeForm[{Opacity[0.3],Thick,Black}],Opacity[0.2],HatchFilling[],Rectangle[{0,0}]},Thickness[0.004],MapThread{#1,#2}&,,,,items,MapThread{#1,#2}&,,,,inv,{Dashed,Opacity[0.4],inversionCenter},AxesTrue
Out[]=
Because inversion keeps tangency, the inversion of the small disk in the problem (black circle in the animation) is tangent to both line and line and circle :
r=1/2*RegionDistance[inv[[1]],inv[[2,1]]]
Out[]=
1
2
and its center is sitting along a line parallel to both of them and have same distance to each. Thus it is on line . Since it is tangent to the circle, the center-center distance is the sum of their radius:
x+y1+
2
2
sol=Simplify@SolveValuesEuclideanDistance1+-y,y,1+,==r+1,y,NegativeReals[[1]]
2
2
1
2
1
2
Out[]=
1
4
2
)The solution is just the inversion of the circle above:
result=invfuncCircle1+-sol,sol,r//FullSimplify
2
2
Out[]=
Circle(10+(-1+2(9-4
4
49
2
),2
7
2
),1
49
2
)Show both disk and its inversion on the same graph:
Show[g1,Graphics[{result/.Circle->Disk,Thick,invResult}]]
Out[]=
Animation
Animation
The diagram in our problem is symmetric about line . The animation showing how the small disk transform from the lower part of the line to the upper part in inversion space. The disk becomes a circle with thick edge because I do not want it cover the whole diagram during transform:
yx
ManipulateinvResult=Circle1+-sol,sol,r;result=invfunc[invResult];Show[g1,Graphics[{result/.If[sol<0||sol>2,Circle->Disk,{ele_:>{Thickness[0.02],ele}}],Thick,invResult}],PlotRange->{{-1,4},{-1.5,2}},ImageSize->{500,400}],{sol,-2,2.4}
2
2