Rectangle

Author

Eric W. Weisstein
August 27, 2010

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Polygons/Rectangle.nb.

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

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

Figure

Block[{a=.6,b=.4},Graphics[{
Line[{{0,0},{a,0},{a,b},{0,b},{0,0}}],
Text[Style["a",Italic],{a/2-.02,-.05}],
Text[Style["b",Italic],{a+.05,b/2+.00}]
}]]

Properties

Cricumradius

Manipulate[Graphics[{Line[{{-a,-b},{a,-b},{a,b},{-a,b},{-a,-b}}/2],Blue,Circle[{0,0},Sqrt[(a^2)+(b^2)]/2]}],{{a,1},1,5},{{b,1},1,5}]

Inequality

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

RegionPlot[ineq[x,y]/.{a->1,b->1/2},{x,-1,1},{y,-1,1}]

Centroid

Assuming[a>0,Centroid[ineq[x,y],{x,y}]]//FullSimplify//Timing

Assuming[a>0&&b>0,Simplify@RegionCentroid[Rectangle[-{a,b}/2,{a,b}/2]]]

Area

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

Assuming[a>0&&b>0,Integrate[1,{x,y}∈Rectangle[-{a,b}/2,{a,b}/2]]]

Assuming[a>0&&b>0,Simplify@Integrate[1,{x,y}∈Rectangle[-{a,b}/2,{a,b}/2]]]

Assuming[a>0&&b>0,RegionMeasure[Rectangle[-{a,b}/2,{a,b}/2]]]

InertiaTensor

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

RadiiOfGyration

Assuming[a>0&&b>0,FullSimplify[RadiiOfGyration[ineq[x,y],{x,y}]]]

GeneralizeDiameter

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

FullSimplify[Maximize[{(x1-x2)^2+(y1-y2)^2,ineqs&&a>0&&b>0},{x1,x2,y1,y2},Reals],a>0&&b>0]//Timing