Stadium

Author

Eric W. Weisstein
July 31, 2014

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

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

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

Definitions

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

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

reg=RegionUnion[Rectangle[-{a/2,r},{a/2,r}],Disk[{a/2,0},r,{-1,1}π/2],Disk[{-a/2,0},r,{1,3}π/2]];

reg2=RegionUnion[Rectangle[-{a/2,r},{a/2,r}],Disk[{a/2,0},r],Disk[{-a/2,0},r]];

assum=a>0&&r>0;

Plots

Diagram

LaminaData["Stadium","Diagram"]

DiscretizeRegion

Block[{a=1,r=3},Show[DiscretizeRegion[#],Axes->True,Ticks->None]]&/@{reg,reg2,implreg}

Block[{a=1,r=1/3},Show[DiscretizeRegion[#],Axes->True,Ticks->None]]&/@{reg,reg2,implreg}

Graphics

Block[{a=1,r=1/2},Graphics[{Opacity[.5],EdgeForm[Black],Hue[.5],Sequence@@#}]]&/@{reg,reg2}

Block[{a=3,r=1},Graphics[{Opacity[.5],EdgeForm[Black],Hue[.5],Sequence@@#}]]&/@{reg,reg2}

Block[{a=1,r=3},Graphics[{Opacity[.5],EdgeForm[Black],Hue[.5],Sequence@@#}]]&/@{reg,reg2}

InequalityPlot

<<Graphics`InequalityGraphics`

InequalityPlot[Stadium[],{x},{y},Axes->False]

RegionPlot

RegionPlot[ineq,{x,-2,2},{y,-2,2}]

Equations

Inequality

ineq=Stadium[a,r]

FullSimplify[%,a>0&&r>0]

ineq[x_,y_]:=(((-(a/2)+x))^2)+(y^2)<(r^2)||((((a/2)+x))^2)+(y^2)<(r^2)||(-(a/2)<x<(a/2)&&-r<y<r)

Properties

Area

Area

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

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

...wrong...

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

Integrate

area=Assuming[a>0&&r>0,Area[ineq,{x,y}]]

Integrate[Boole[Stadium[a,r]],{x,-∞,∞},{y,-∞,∞},Assumptions->r>0&&a>0]//Timing

RegionMeasure

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

Assuming[assum,FullSimplify[RegionMeasure[reg2]]]//Timing

...wrong...

Assuming[assum,FullSimplify[RegionMeasure[implreg]]]//Timing

...wrong...

AreaInertiaTensor

Assuming[a>0&&r>0,AreaInertiaTensor[ineq,{x,y}]]//FullSimplify

Centroid

Integrate

Assuming[a>0&&r>0,Centroid[ineq,{x,y}]]

RegionCentroid

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

Assuming[assum,FullSimplify[RegionCentroid[reg2]]]//Timing

Assuming[assum,FullSimplify[RegionCentroid[implreg]]]//Timing

Convex

TimeConstrained[Region`ConvexRegionQ[reg],600]//Timing

TimeConstrained[Region`ConvexRegionQ[implreg],600]//Timing

GeneralizedDiameter

ineq[x_,y_]:=(((-(a/2)+x))^2)+(y^2)<(r^2)||((((a/2)+x))^2)+(y^2)<(r^2)||(-(a/2)<x<(a/2)&&-r<y<r)

ineqs=FullSimplify[And@@ineq@@@{{x1,y1},{x2,y2}},a>0&&r>0]

Maximize[{(x1-x2)^2+(y1-y2)^2,ineqs},{x1,x2,y1,y2},Reals]//Timing

RadiiOfGyration

Assuming[a>0&&r>0,FullSimplify[RadiiOfGyration[ineq[x,y],{x,y}]]]//Timing