Circle-Circle Intersection

Author

Eric W. Weisstein
September 22, 2007

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PlaneGeometry/Circle-CircleIntersection.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Circle-CircleIntersection.html.

©2007 Wolfram Research, Inc. except for portions noted otherwise

Area

A[R_,r_,d_]:=r^2 ArcCos[(d^2+r^2-R^2)/(2d r)]+R^2 ArcCos[(d^2+R^2-r^2)/(2d R)]-Sqrt[(-d+r+R)(d+r-R)(d-r+R)(d+r+R)]/2

v5.2

Integrate[Boole[x^2+y^2<R^2&&(x-d)^2+y^2<r^2],{x,-∞,∞},{y,-∞,∞},Assumptions->r>0&&R>0&&d>0]//Timing

(area=FullSimplify[Integrate[Boole[x^2+y^2<R^2&&(x-d)^2+y^2<r^2],{x,-∞,∞},{y,-∞,∞},Assumptions->r>0&&R>0&&d>0],
r>0&&R>0&&d>0])//Timing//InputForm

(area=FullSimplify[Integrate[Boole[x^2+y^2<R^2&&(x-d)^2+y^2<r^2],{x,-∞,∞},{y,-∞,∞},Assumptions->r>0&&R>0&&d∈Reals],
r>0&&R>0&&d∈Reals])//Timing//InputForm

FullSimplify[area,d>0&&r>0&&R>0]

r inside R

FullSimplify[area,r<R&&d+r<R&&d>0]

no overlap

FullSimplify[area,d>R+r&&r>0&&R>0]

Overlapping

FullSimplify[area,0<d<R+r&&r>0&&R>0]

Tangent

FullSimplify[area,d==-(r+R)&&r>0&&R>0&&d<0]

FullSimplify[area,d==r+R&&r>0&&R>0&&d==0]

Integrate[2 (Sqrt[(r^2)-(x^2)]),{x,-R,R},Assumptions->R==r]

Integrate[2 (Sqrt[(r^2)-(x^2)]),{x,-R,R},Assumptions->R==r&&(r|R)∈Reals]

Integrate[2 (Sqrt[(R^2)-(x^2)]),{x,-R,R},Assumptions->R>0]

FullSimplify[area,d==r+R&&r>0&&R>0&&d>0]

v6.0.1

Integrate[Boole[x^2+y^2<R^2&&(x-d)^2+y^2<r^2],{x,-∞,∞},{y,-∞,∞}]//Timing

Integrate[Boole[x^2+y^2<R^2&&(x-d)^2+y^2<r^2],{x,-∞,∞},{y,-∞,∞},Assumptions->r>0&&R>0&&d>0]//Timing

Circle-Circle Intersections (Cartesian Coordinates)

circ[1]=Circle@@@{{{-2,0},1},{{2,0},1}};
circ[2]=Circle@@@{{{-1,0},1},{{1,0},1}};
circ[3]=Circle@@@{{{-1/2,0},1},{{1/2,0},1}};
Intersections@@@{circ[1],circ[2],circ[3]}

cplot[c_List]:=Module[{pts},
Graphics[{
c,
AbsolutePointSize[6],CircleCenter/@c,
RGBColor[1,0,0],pts=Intersections@@c
},AspectRatio->Automatic,Axes->True,PlotLabel->TraditionalForm/@{0,± (Coordinates/@pts)[[-1,-1]]}]
]

Show[GraphicsArray[Table[cplot[circ[i]],{i,3}]],GraphicsSpacing->-.15]

Radical Line

rl=Simplify[ToSidelengths[RadicalLine[
circ1=Circle[{alpha1,beta1,gamma1},r1],
circ2=Circle[{alpha2,beta2,gamma2},r2]
]]]

lineofcenters=TrilinearLine[Line@@(ctrs=Center/@{circ1,circ2})]

pt=Intersections[rl,lineofcenters]

/.d->Distance@@ctrs

eqn1=Distance[{α,β,γ},pt]^2-((4d^2r1^2-(d^2-r1^2+r2^2)^2)/(4d^2));
eqn2=Distance[{α,β,γ},lineofcenters]^2-((4d^2r1^2-(d^2-r1^2+r2^2)^2)/(4d^2));

(gb=Factor/@GroebnerBasis[{
Numerator[Together[eqn1]],
Numerator[Together[eqn2]],
a α+b β+c γ-2Area
},{α,β,γ}])//Timing

d = R+r

A[R_,d_]:=R^2 ArcCos[d/R]-d Sqrt[R^2-d^2]
(Subscript[d, 1]):=(d^2-r^2+R^2)/(2d)
(Subscript[d, 2]):=(d^2+r^2-R^2)/(2d)

a

Factor[4d^2R^2-(d^2-r^2+R^2)^2]

Factor[(-d+r-R)(-d-r+R)(-d+r+R)(d+r+R)]

%-%%

A

A=Simplify[A[R,(Subscript[d, 1])]+A[r,(Subscript[d, 2])]]

Simplify[PowerExpand[Together//@A]]

Factor[-(d^4)-((((r^2)-(R^2)))^2)+2 (d^2) ((r^2)+(R^2))]

(d-r-R)(d+r-R)(d-r+R)(d+r+R)

Simplify[A /. d->R+r]

Simplify[Together//@(Simplify[A /.r->R])]

Half Area Overlaps

(1/2) (-2 d (Sqrt[(r^2)-(((((d^2)+(r^2)-(R^2)))^2)/(4 (d^2)))])+2 (r^2) ArcCos[(((d^2)+(r^2)-(R^2))/(2 d r))]+2 (R^2) ArcCos[(((d^2)-(r^2)+(R^2))/(2 d R))])/.{R->1,r->1}//FullSimplify

Solve[-(1/2) d (Sqrt[4-(d^2)])+2 ArcCos[(d/2)]==(π/2),d]

Reduce[-(1/2) d (Sqrt[4-(d^2)])+2 ArcCos[(d/2)]==(π/2)&&1/2<d<1,d,Reals]//Timing

d=0.8079455065990344186379234801326308858044719291481968444978`30;
g1=RegionPlot[(x+d/2)^2+y^2<1&&(x-d/2)^2+y^2<1,{x,-1,1},{y,-1,1},PlotStyle->Cyan,Frame->False];
g2=Graphics[{
Circle[{-d/2,0},1],Circle[{d/2,0},1],
PointSize[.02],Point[{{-1,0},{1,0}}d/2]
}];

Show[{g1,g2},Axes->True,PlotRange->All,AspectRatio->Automatic]

Show[Graphics/@First/@{g1,g2},Axes->True,PlotRange->All,AspectRatio->Automatic]

Show[{g2,g1},Axes->True]

Region

Manipulate[RegionPlot[x^2+y^2≤a^2&&(x-c)^2+y^2≤b^2,{x,-2,2},{y,-2,2}],{a,.1,2},{b,.1,2},{c,-1,1}]

Inequality

ineq[x_,y_]:=x^2+y^2≤R^2&&(x-d)^2+y^2≤r^2

Area

Assuming[R>0&&r>0&&d<R+r,Centroid[ineq[x,y],{x,y}]]

Centroid

Assuming[a>0&&b>0&&c<a+b,Centroid[ineq[x,y],{x,y}]]

Quit