Lune

Author

Eric W. Weisstein
November 22, 2008

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PlaneGeometry/Lune.nb.

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

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

Code

FilledPolygon[x_List,color_:Yellow]:={{color,Polygon[x]},ClosedLine[x]}

Figure

With[{a=1,b=1.212,c=.7},Show[{
RegionPlot[(x^2+y^2<a^2&&(x-c)^2+y^2>b^2),{x,-1.2,2},{y,-1.2,1.2},AspectRatio->Automatic,Frame->False,PlotStyle->Hue[.5],MaxRecursion->4],
Graphics[{Circle[{0,0},a],Circle[{c,0},b]
(*,PointSize[.015],Point[{{0,0},{c,0}}]*)
}]
},Method->{Antialiasing->True}]]

Lune Area

LuneArea[{aa_,bb_},c_]:=With[{fourd=(Sqrt[-(aa-bb-c) (aa+bb-c) (aa-bb+c) (aa+bb+c)]),a=Min[{aa,bb}],b=Max[{aa,bb}]},(fourd/2)-(b^2) ((π/2)+ArcTan[(((a^2)-(b^2)-(c^2))/fourd)])+(a^2) (ArcCos[((b-c)/a)]+ArcTan[((b-c)/(Sqrt[(a+b-c) (a-b+c)]))]+ArcTan[(((a^2)-(b^2)+(c^2))/fourd)])]

A[R_,d_]:=R^2 ArcCos[d/R]-d Sqrt[R^2-d^2]

FullSimplify[A[a,-(((a^2)-(b^2)+(c^2))/(2 c))]-A[b,c-(((a^2)-(b^2)+(c^2))/(2 c))]]

LuneArea2[{a_,b_},c_]:=(1/2)(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)])+(a^2) ArcSec[-((2 a c)/((a^2)-(b^2)+(c^2)))]-(b^2) ArcSec[((2 b c)/(-(a^2)+(b^2)+(c^2)))]

FullSimplify[LuneArea2[{a,b},c]]

FullSimplify[Expand[4 (a^2) (c^2)-((((a^2)-(b^2)+(c^2)))^2)]]

LuneArea[a,b,c]/.{(Sqrt[(a+b-c) (a-b+c) (-a+b+c) (a+b+c)])->4Δ,1/(Sqrt[(a+b-c) (a-b+c) (-a+b+c) (a+b+c)])->1/(4Δ)}//TraditionalForm

LuneAreaNumeric[a_,b_,c_]:=
NIntegrate[Boole[(x^2+y^2<a^2&&(x-c)^2+y^2>b^2)],
{x,(-a-b+c)-(((a^2)-(b^2)+(c^2))/(2 c)),(((a^2)-(b^2)+(c^2))/(2 c))},{y,-Max[a,b],Max[a,b]}]//Chop

Assumptions

FullSimplify[(a^2)-(((((a^2)-(b^2)+(c^2)))^2)/(4 (c^2)))>0,(a|b|c)∈Reals]

assum=a>0&&b>0&&c>0&&2a c>(a^2)-(b^2)+(c^2);

Integral (x, y)

Integrate[Boole[(x^2+y^2<a^2&&(x-c)^2+y^2>b^2)],{x,-∞,∞},{y,-∞,∞},Assumptions->assum]//Timing

(i=FullSimplify[Integrate[Boole[(x^2+y^2<a^2&&(x-c)^2+y^2>b^2)],{x,-∞,∞},Assumptions->assum],assum]/.r_Root:>ToRadicals[r,Assumptions->assum])//Timing

(i2=Integrate[i,{y,-∞,∞},Assumptions->assum])//Timing

(i3=FullSimplify[i2,assum])//Timing

i3/.{a->1,b->1.212,c->.5,HoldPattern[Assumptions->_]:>Sequence@@{},Integrate:>NIntegrate}

Integral (y, x)

Integrate[Boole[(x^2+y^2<a^2&&(x-c)^2+y^2>b^2)],{y,-∞,∞},{x,-∞,∞},Assumptions->assum]//Timing

(i=FullSimplify[Integrate[Boole[(x^2+y^2<a^2&&(x-c)^2+y^2>b^2)],{y,-∞,∞},Assumptions->assum],assum]/.r_Root:>ToRadicals[r,Assumptions->assum])//Timing

(i2=Integrate[i,{x,-∞,∞},Assumptions->assum])//Timing

With[{a=1,b=1.212,c=.5},2NIntegrate[(Piecewise[{{(Sqrt[(a^2)-(x^2)]), -a<x≤c-b}, {(-(Sqrt[(b^2)-(((c-x))^2)])+(Sqrt[(a^2)-(x^2)])), c-b< x<(((a^2)+(c^2)-(b^2))/(2c))}}]),{x,-2,2}]]

2Integrate[(Piecewise[{{(Sqrt[(a^2)-(x^2)]), -a<x≤c-b}, {(-(Sqrt[(b^2)-(((c-x))^2)])+(Sqrt[(a^2)-(x^2)])), c-b< x<(((a^2)+(c^2)-(b^2))/(2c))}}]),{x,-∞,∞},Assumptions->assum]

FullSimplify[%,assum]

all

Refine[iv,0<b<a<c]

Refine[iv,assum&&0<c<a<b&&a+c>b]//FullSimplify

0<c<a<b

Refine[iv,assum&&0<c<b<a]

FullSimplify[%81,assum&&0<c<b<a]

(1/2) (Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)])-(1/2)(b^2) π- (b^2) ArcTan[(((a^2)-(b^2)-(c^2))/(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]))]+(a^2) (ArcCos[((b-c)/a)]+ArcTan[((b-c)/(Sqrt[(a+b-c) (a-b+c)]))]+ArcTan[(((a^2)-(b^2)+(c^2))/(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]))])/.{a->1,b->1.212,c->.5}

(1/2) (Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)])-(1/2)(b^2) π- (b^2) ArcTan[(((a^2)-(b^2)-(c^2))/(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]))]+(a^2) (ArcCos[((b-c)/a)]+ArcTan[((b-c)/(Sqrt[(a+b-c) (a-b+c)]))]+ArcTan[(((a^2)-(b^2)+(c^2))/(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]))])/.{a->1,c->1.212,b->.5}

LuneAr

(1/2) (Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)])- (b^2)( ArcTan[(((a^2)-(b^2)-(c^2))/(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]))]+(π/2))+(a^2) (ArcCos[((b-c)/a)]+ArcTan[((b-c)/(Sqrt[(a+b-c) (a-b+c)]))]+ArcTan[(((a^2)-(b^2)+(c^2))/(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]))])/.{a->1,b->1.212,c->.5}

(1/2) (Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)])+(b^2)ArcCot[(((a^2)-(b^2)-(c^2))/(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]))]+(a^2) (ArcCos[((b-c)/a)]+ArcTan[((b-c)/(Sqrt[(a+b-c) (a-b+c)]))]+ArcTan[(((a^2)-(b^2)+(c^2))/(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]))])/.{a->1,b->1.212,c->.5}

(1/2) (Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)])- (b^2)( ArcTan[(((a^2)-(b^2)-(c^2))/(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]))]+(π/2))+(a^2) (ArcCos[((b-c)/a)]+ArcTan[((b-c)/(Sqrt[(a+b-c) (a-b+c)]))]+ArcTan[(((a^2)-(b^2)+(c^2))/(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)]))])/.{(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)])->s,1/(Sqrt[-(a-b-c) (a+b-c) (a-b+c) (a+b+c)])->1/s}

Numeric

With[{a=1,b=1.212,c=.5},RegionPlot[(x^2+y^2<a^2&&(x-c)^2+y^2>b^2),{x,(-a-b+c)-(((a^2)-(b^2)+(c^2))/(2 c)),(((a^2)-(b^2)+(c^2))/(2 c))},{y,-Max[a,b],Max[a,b]},AspectRatio->Automatic]
]

Through[{LuneArea,LuneAreaNumeric}[1,1.212,.5]]

With[{a=.9,b=1.2,c=.4},RegionPlot[(x^2+y^2<a^2&&(x-c)^2+y^2>b^2),{x,-.9,-.6},{y,-.7,.7},AspectRatio->Automatic]
]

Through[{LuneArea,LuneAreaNumeric}[.9,1.2,.4]]

Through[{LuneArea,LuneAreaNumeric}[1.2,.9,.4]]

LuneArea2[{1.2,.9},.4]

Squarable Lunes

First Lune

Simplify[Circumcircle[Triangle[{{-r,0},{0,r},{0,0}}]],r>0]

lune1=With[{r=1},InequalityPlot[x^2+y^2>r^2&&(x+r/2)^2+(y-r/2)^2<r^2/2,{x},{y},
Epilog->{{Red,Circle[{0,0},r]},Circle[{-r,r}/2,r/Sqrt[2]],FilledPolygon[{{-r,0},{0,0},{0,r}},Yellow]},PlotRange->{{-1.3,1.1},{-1.1,1.3}},Ticks->None]
]

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

Simplify[Norm[{-r,r}/2],r>0]

FullSimplify[LuneArea[{r,(r/(Sqrt[2]))},(r/(Sqrt[2]))],r>0]

With[{r=1},RegionPlot[x^2+y^2>r^2&&(x+r/2)^2+(y-r/2)^2<r^2/2,{x,-1.25,0},{y,0,1.25}]]

With[{r=1},NIntegrate[Boole[x^2+y^2>r^2&&(x+r/2)^2+(y-r/2)^2<r^2/2],{x,-1.25,0},{y,0,1.25}]]

Second Lune

lune2=With[{r=1},InequalityPlot[x^2+y^2<r^2&&x^2+(y+r)^2>2r^2,{x},{y},Epilog->{{Red,Circle[{0,0},r]},Circle[{0,-r},Sqrt[2]r],
Line[{{-r,0},{0,-r},{r,0}}],FilledPolygon[{{-r,0},{0,-r},{r,0}},Yellow]
},PlotRange->{{-1.5,1.5},{-2.5,1.1}},Ticks->None]
]

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

Simplify[Norm[{0,-r}],r>0]

FullSimplify[LuneArea[{r,(Sqrt[2])r},r],r>0]

With[{r=1},RegionPlot[x^2+y^2<r^2&&x^2+(y+r)^2>2r^2,{x,-1,1},{y,0,1},MaxRecursion->5,AspectRatio->Automatic]]

Graphic

Show[GraphicsArray[{lune1,lune2}],ImageSize->500]

Double Lune

Circumcircle[Triangle[{{0,0},{0,a},{0,-b}}]]

...doesn't handle this case gracefully...

Solve[(#[[1]]-x0)^2+(#[[2]]-y0)^2==r^2&/@{{0,0},{a,0},{0,-b}},{x0,y0,r}]

With[{a=2,b=1},
Show[Graphics[{
InequalityPlot[{(x-a/2)^2+(y+b/2)^2>(a^2+b^2)/4&&(x-a/2)^2+y^2<a^2/4},{x},{y},DisplayFunction->Identity][[1]],
InequalityPlot[{(x-a/2)^2+(y+b/2)^2>(a^2+b^2)/4&&x^2+(y+b/2)^2<b^2/4},{x},{y},DisplayFunction->Identity][[1]],
{
FilledPolygon[{{0,0},{a,0},{0,-b}},Yellow],
{Red,Circle[{a,-b}/2,Sqrt[a^2+b^2]/2]},
Circle[{a,0}/2,a/2],
Circle[{0,-b}/2,b/2]
}
}],
PlotRange->{{-.5,2.2},{-1.7,1.1}},Ticks->None,AspectRatio->Automatic,Axes->True]
]

Top Lune

With[{a=2,b=1},{
NIntegrate[Boole[(x-a/2)^2+(y+b/2)^2>(a^2+b^2)/4&&(x-a/2)^2+y^2<a^2/4],{x,-∞,∞},{y,-∞,∞}],
(1/8) (a (2 b+a π)-2 ((a^2)+(b^2)) ArcTan[(a/b)])//N
}]

(i1=FullSimplify[Integrate[Boole[(x-a/2)^2+(y+b/2)^2>(a^2+b^2)/4&&(x-a/2)^2+y^2<a^2/4],{x,-∞,∞},{y,-∞,∞},Assumptions->a>0&&b>0],a>0&&b>0])//Timing

Last[%]/.{a->2,b->1}//N

With[{a=2,b=1},
NIntegrate[Boole[(x-a/2)^2+(y+b/2)^2>(a^2+b^2)/4&&(x-a/2)^2+y^2<a^2/4],{x,-∞,∞},{y,-∞,∞}]]

Simplify[Norm[{a/2,-b/2}-{a/2,0}],b>0]

FullSimplify[LuneArea[{(1/2)(Sqrt[a^2+b^2]),(a/2)},(b/2)],0<a<b]

(1/8) (2 a b-(b^2) π+2 (a^2) ArcSin[((b-(Sqrt[(a^2)+(b^2)]))/a)]+2 ((a^2)+(b^2)) ArcTan[(b/a)]+2 (a^2) ArcTan[((Sqrt[-1+((Sqrt[(a^2)+(b^2)])/b)])/(Sqrt[2]))])/.{a->2.,b->1.}

FullSimplify[LuneArea[{(1/2)(Sqrt[a^2+b^2]),(a/2)},(b/2)],0<b<a]

(1/8) (2 a b-(b^2) π+2 (a^2) ArcSin[((b-(Sqrt[(a^2)+(b^2)]))/a)]+2 ((a^2)+(b^2)) ArcTan[(b/a)]+2 (a^2) ArcTan[((Sqrt[-1+((Sqrt[(a^2)+(b^2)])/b)])/(Sqrt[2]))])/.{a->2.,b->1.}

Left Lune

(i2=FullSimplify[Integrate[Boole[(x-a/2)^2+(y+b/2)^2>(a^2+b^2)/4&&x^2+(y+b/2)^2<b^2/4],{x,-∞,∞},{y,-∞,∞},Assumptions->a>0&&b>0],a>0&&b>0])//Timing

FullSimplify[Refine[i2,a>0]]

With[{a=2,b=1},
NIntegrate[Boole[(x-a/2)^2+(y+b/2)^2>(a^2+b^2)/4&&x^2+(y+b/2)^2<b^2/4],{x,-∞,∞},{y,-∞,∞}]]//N

i2/.{a->2,b->1}//N

Simplify[Norm[{a/2,-b/2}-{0,-b/2}],a>0]

FullSimplify[LuneArea[{(1/2)(Sqrt[(a^2)+(b^2)]),(b/2)},(a/2)],0<a<b]

(1/8) (a (2 b-a π+2 a ArcTan[(a/b)])+2 (b^2) (ArcSin[((a-(Sqrt[(a^2)+(b^2)]))/b)]+ArcTan[(a/b)]+ArcTan[((Sqrt[-1+((Sqrt[(a^2)+(b^2)])/a)])/(Sqrt[2]))]))/.{a->2.,b->1.}

FullSimplify[LuneArea[{(1/2)(Sqrt[(a^2)+(b^2)]),(b/2)},(a/2)],0<b<a]

(1/8) (a (2 b-a π+2 a ArcTan[(a/b)])+2 (b^2) (ArcSin[((a-(Sqrt[(a^2)+(b^2)]))/b)]+ArcTan[(a/b)]+ArcTan[((Sqrt[-1+((Sqrt[(a^2)+(b^2)])/a)])/(Sqrt[2]))]))/.{a->2.,b->1.}

Sum

FullSimplify[i1+i2,a>0&&b>0]

FullSimplify[i1+i2,a>0]

sum=(1/8) (2 a b-(b^2) π+2 (a^2) ArcSin[((b-(Sqrt[(a^2)+(b^2)]))/a)]+2 ((a^2)+(b^2)) ArcTan[(b/a)]+2 (a^2) ArcTan[((Sqrt[-1+((Sqrt[(a^2)+(b^2)])/b)])/(Sqrt[2]))])+(1/8) (a (2 b-a π+2 a ArcTan[(a/b)])+2 (b^2) (ArcSin[((a-(Sqrt[(a^2)+(b^2)]))/b)]+ArcTan[(a/b)]+ArcTan[((Sqrt[-1+((Sqrt[(a^2)+(b^2)])/a)])/(Sqrt[2]))]));

FullSimplify[sum,0<a<b]

FullSimplify[sum,0<b<a]

Table[sum-a b/2/.{a->RandomReal[],b->RandomReal[]},{100}]//Chop//Union

FullSimplify[TrigToExp[sum],a>0&&b>0]

FullSimplify[TrigToExp[sum],0<a<b]

FullSimplify[TrigToExp[sum],0<b<a]