Lens

Author

Eric W. Weisstein
July 30, 2014

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Laminae/Lens.nb.

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

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

Asymetric Lens

Definitions

ineq=(x+d/2)^2+y^2≤R^2&&(x-d/2)^2+y^2≤r^2;

implreg=ImplicitRegion[ineq,{x,y}];

reg=RegionIntersection[Disk[{-d/2,0},R],Disk[{d/2,0},r]];

assum=R>0&&r>0&&0<d<r+R;

Figure

Diagram

LaminaData["LensAsymmetric","Diagram"]

DiscretizeRegion

Block[{R=1,r=.8,d=1.5},Show[DiscretizeRegion[reg],ImageSize->Small]]

Block[{R=1,r=.8,d=1.5},Show[DiscretizeRegion[implreg],ImageSize->Small]]

RegionPlot

Maximize[{y,(x+d/2)^2+y^2==R^2,(x-d/2)^2+y^2==r^2},{x,y}]

ii[{x_,y_},{R_,r_,d_}]:=(x+d/2)^2+y^2≤R^2&&(x-d/2)^2+y^2≤r^2

Manipulate[RegionPlot[ii[{x,y},{R,r,d}],{x,d/2-r,-d/2+R},{y,-Sqrt[(-d+r+R)(d+r-R)(d-r+R)(d+r+R)]/(2d),Sqrt[(-d+r+R)(d+r-R)(d-r+R)(d+r+R)]/(2d)},PlotRange->All],{{d,1},.1,2},{{r,1},.1,2},{{R,1},.1,2}]

GraphicsGrid[{Function[{R,r,d},RegionPlot[ii[{x,y},{R,r,d}],{x,d/2-r,-d/2+R},{y,-Sqrt[(-d+r+R)(d+r-R)(d-r+R)(d+r+R)]/(2d),Sqrt[(-d+r+R)(d+r-R)(d-r+R)(d+r+R)]/(2d)},Frame->False,AspectRatio->Automatic]]@@@{{1,.8,1.5},{.6,1,1},{1,1.5,1}}},Dividers->All,ImageSize->400]

Perimeter

Centroid

Area

Numerical

Block[{r=1,R=1,d=1},NIntegrate[Boole[ineq[x,y]],{x,-.7,.7},{y,-1,1}]]

Block[{r=1,R=1.5,d=2},NIntegrate[Boole[ineq[x,y]],{x,-3,3},{y,-3,3}]]

V7

(i=Assuming[r>0&&R>0&&0<d<R+r,Integrate[Boole[ineq[x,y]],{x,-∞,∞},{y,-∞,∞},GenerateConditions->True]])//Timing

...wrong...

ByteCount[i]

i/.{r->1,R->1,d->1}//N

2%

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

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

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

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

Simplify[((-(Sqrt[-(d-r-R) (d+r-R) (d-r+R) (d+r+R)]) ((d^2)+(r^2)-(R^2))+4 (d^2) (r^2) ArcSec[((2 d r)/((d^2)+(r^2)-(R^2)))])/(4 (d^2)))/.{d->a,r->a,R->a},a>0]

FullSimplify[-(1/2) d Sqrt[4 a^2-d^2]+a^2 Pi-2 a^2 ArcTan[d/Sqrt[4 a^2-d^2]]/.d->a,a>0]

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

V8

{$Version,$ReleaseNumber}

$TopDirectory

(i=Assuming[r>0&&R>0&&0<d<R+r,Integrate[Boole[ineq[x,y]],{x,-∞,∞},{y,-∞,∞}]])//Timing

ByteCount[i]

i/.{d->1,R->1,r->1}

i/.{d->1,r->1}/.R->1.

(expr=FullSimplify[i,r>0&&R>0&&0<d<R+r&&d≠r])//Timing

Numeric

i/.{d->1,R->1,r->1.0001}

Block[{d=1,r=1,R=1},NIntegrate[Boole[ineq[x,y]],{x,d/2-r,-d/2+r},{y,-Sqrt[(-d+r+r)(d+r-r)(d-r+r)(d+r+r)]/(2d),Sqrt[(-d+r+r)(d+r-r)(d-r+r)(d+r+r)]/(2d)}]]

Block[{d=.6,r=.9,R=1.2},RegionPlot[ineq[x,y],{x,-.6,1},{y,-.9,.9}]]

Block[{d=.6,r=.9,R=1.2},NIntegrate[Boole[ineq[x,y]],{x,-.6,1},{y,-.9,.9}]]

i/.{d->.6,R->1.2,r->.9}

Area

Assuming[assum,FullSimplify[Area[reg]]]//Timing

Centroid

(centroid=Integrate[{x,y}Boole[ineq[x,y]],{x,-∞,∞},{y,-∞,∞},GenerateConditions->True,Assumptions->r>0&&R>0&&0<d<R+r&&d+r>R&&d+R>r])//Timing

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

Manipulate[RegionPlot[(x+d/2)^2+y^2≤R^2&&(x-d/2)^2+y^2≤r^2,{x,-2,2},{y,-2,2}],{d,.1,2},{R,.1,2},{r,.1,2}]

InertiaTensor

FullSimplify[Assuming[a>0&&0<b<2a,AreaInertiaTensor[ineq[x,y],{x,y}]],a>0&&0<b<2a]//Timing

Symetric Lens

Definitions

ineq=(x+d/2)^2+y^2≤a^2&&(x-d/2)^2+y^2≤a^2;

implreg=ImplicitRegion[ineq,{x,y}];

reg=RegionIntersection[Disk[{-d/2,0},a],Disk[{d/2,0},a]];

assum=a>0&&d>0;

Figure

Diagram

LaminaData["LensSymmetric","Diagram"]

Manipulate

Manipulate[DiscretizeRegion[RegionIntersection[Disk[{-d/2,0},a],Disk[{d/2,0},a]]],{{a,1},0,2},{{d,.2},0,2}]

DiscretizeRegion

Block[{a=1,d=1.5},Show[DiscretizeRegion[reg],ImageSize->Small]]

Block[{a=1,d=1.5},Show[DiscretizeRegion[implreg],ImageSize->Small]]

RegionPlot

ii[{x_,y_},{r_,d_}]:=(x+d/2)^2+y^2≤r^2&&(x-d/2)^2+y^2≤r^2

RegionPlot[ii[{x,y},{r,d}],{x,d/2-r,-d/2+r},{y,-Sqrt[(-d+r+r)(d+r-r)(d-r+r)(d+r+r)]/(2d),Sqrt[(-d+r+r)(d+r-r)(d-r+r)(d+r+r)]/(2d)},Frame->False,AspectRatio->Automatic]]@@@{{1,.8},{1,1.2},{1,1.6}}}

GraphicsGrid[{Function[{r,d},RegionPlot[ii[{x,y},{r,d}],{x,d/2-r,-d/2+r},{y,-Sqrt[(-d+r+r)(d+r-r)(d-r+r)(d+r+r)]/(2d),Sqrt[(-d+r+r)(d+r-r)(d-r+r)(d+r+r)]/(2d)},Frame->False,AspectRatio->Automatic]]@@@{{1,.8},{1,1.2},{1,1.6}}},Dividers->All,ImageSize->400]

Inequality

ineq[x_,y_]:=(x-b/2)^2+y^2≤a^2&&(x+b/2)^2+y^2≤a^2

With[{a=1,b=1.6},
RegionPlot[(x-b/2)^2+y^2≤a^2&&(x+b/2)^2+y^2≤a^2,{x,-a-b,a+b},{y,-a,a},AspectRatio->Automatic,MaxRecursion->5]]

Perimeter

2 2ArcSin[((Sqrt[3])/2)]

Centroid

a≠b

Assuming[a>0&&b<2a,Centroid[ineq[x,y],{x,y}]]//Timing

a == b

Centroid[ineq[x,y]/.b->a,{x,y}]//Timing

Area

Assuming[a>0,Area[ineq[x,y]/.b->a,{x,y}]]

FullSimplify[Assuming[a>0&&0<b<2a,Area[ineq[x,y],{x,y}]],a>0&&0<b<2a]//Timing

FullSimplify[-(1/2) b (Sqrt[4 (a^2)-(b^2)])+(a^2) π-2 (a^2) ArcTan[(b/(Sqrt[4 (a^2)-(b^2)]))]/.b->a,a>0]

InertiaTensor

FullSimplify[Assuming[a>0&&0<b<2a,AreaInertiaTensor[ineq[x,y],{x,y}]],a>0&&0<b<2a]//Timing