Parallelogram

Author

Eric W. Weisstein
July 30, 2014

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

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

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

Definitions

ineq=y≥0&&y Cos[A]+b Sin[A]≥x Sin[A]&&a Sin[A]≥y&&x Sin[A]≥y Cos[A];

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

reg=Polygon[{{0,0},{b,0},{b+a Cos[A],a Sin[A]},{a Cos[A],a Sin[A]}}];

reg2=Parallelogram[{0,0},{{b,0},a{Cos[A],Sin[A]}}];

assum=a>0&&b>0&&0<A<π/2;

Plots

Diagram

LaminaData["FilledParallelogram","Diagram"]

DiscretizeRegion

Block[{a=1,b=1.5,A=40Degree},Show[DiscretizeRegion[reg],ImageSize->Small,Axes->True]]

Block[{a=1,b=3/2,A=40Degree},Show[DiscretizeRegion[reg2//N],ImageSize->Small,Axes->True]]

Block[{a=1,b=3/2,A=40Degree},Show[DiscretizeRegion[implreg],ImageSize->Small,Axes->True]]

V10.0.0

Block[{a=1,b=3/2,A=40Degree},Show[DiscretizeRegion[reg2],ImageSize->Small,Axes->True]]

V10.0.1

Block[{a=1,b=3/2,A=40Degree},Show[DiscretizeRegion[reg2],ImageSize->Small,Axes->True]]

RegionPlot

Block[{a=1,b=3/2,A=40Degree},RegionPlot[ineq,{x,0,b+Cos[A]},{y,0,a Sin[A]},AspectRatio->Automatic,ImageSize->Small,Frame->False]]

Polygon

Graphics[Block[{a=1,b=3/2,A=40Degree},reg]]

Diagonals

v1={1,0};
v2={.3,.6};
Show[Graphics[
{
pgram=Parallelogram[v1,v2],
{Dashing[{.02}],Diagonals[p]},
PointLabels[Transpose[{Point/@{{0,0},v1,v1+v2,v2},CharacterRange["A","D"]}]]
},AspectRatio->Automatic,PlotRange->All]
]

Norm/@{v1+v2,v2-v1}

{
{AA,BB,AA,BB}=Angles[pgram],
{aa,bb,cc,dd}=SideLengths[Evaluate[pgram]]
}

{(Sqrt[(aa^2)+(bb^2)-2aa bb Cos[AA]]),(Sqrt[(aa^2)+(bb^2)+2aa bb Cos[BB]])}

{(Sqrt[(aa^2)+(bb^2)+2aa bb Cos[AA]]),(Sqrt[(aa^2)+(bb^2)-2aa bb Cos[BB]])}

Area

AA+BB

Sin[Pi-x]

{aa bb Sin[AA],aa bb Sin[BB]}

Sides

Eliminate[{p^2==a^2+b^2-2a b Cos[A],q^2==a^2+b^2+2a b Cos[A]},Cos[A]]

Diagonal Area Theorem

v1={1,0};
v2={.3,.6};
x=.25(v1+v2);
i1=Coordinates[Intersections[Line[{x,x+v2}],#]]&/@{Line[{{0,0},v1}],Line[{v2,v1+v2}]};
i2=Coordinates[Intersections[Line[{x,x+v1}],#]]&/@{Line[{{0,0},v2}],Line[{v1,v1+v2}]};

Show[Graphics[
{
Parallelogram[v1,v2],
{Blue,Line[{{0,0},v1+v2}]},
{Red,PointSize[.02],
Point[x],Line/@{i1,i2}
}
}],AspectRatio->Automatic]

{i1,i2}

Area/@{Evaluate[Parallelogram[x-i1[[1]],v1-i1[[1]]]],
Evaluate[Parallelogram[x-i2[[1]],v2-i2[[1]]]]}

Erected Square

p1=Parallelogram[{1,0},{.7,.5}];
c1=ErectedPolygonCenters[p1,4];
c2=ErectedPolygonCenters[p1,4,-1];

Show[GraphicsArray[{
Graphics[{
{AbsoluteThickness[3],p1},
ErectPolygons[p1,4],
{Red,PointSize[.04],Point/@c1,ClosedLine[c1]}},AspectRatio->Automatic],
Graphics[{
{AbsoluteThickness[3],p1},
ErectPolygons[p1,4,-1],
{Red,PointSize[.05],Point/@c2,ClosedLine[c2]}},AspectRatio->Automatic]}]]

Equations

Inequalities

poly=Polygon[{{0,0},{b,0},{b+a Cos[A],a Sin[A]},{a Cos[A],a Sin[A]}}];

Block[{b=1,a=.6,A=70Degree},Graphics[poly]]

FullSimplify[Inequalities[poly,{x,y}],a>0&&b>0&&0<A<π]

ineq[x_,y_]:=y≥0&&y Cos[A]+b Sin[A]≥x Sin[A]&&a Sin[A]≥y&&x Sin[A]≥y Cos[A]

Block[{b=1,a=.6,A=70Degree},RegionPlot[ineq[x,y],{x,0,b+a Cos[A]},{y,0,a Sin[A]},AspectRatio->Automatic]]

Properties

Area

Area

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

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

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

V7 Integrate

$Version

Integrate[Boole[ineq[x,y]],{x,-∞,∞},{y,-∞,∞},Assumptions->a>0&&b>0&&0<A<π]//Timing

FullSimplify[Last[%],a>0&&b>0&&0<A<π]

V8 Integrate

(area=Integrate[Boole[ineq[x,y]],{x,-∞,∞},{y,-∞,∞},Assumptions->a>0&&b>0&&0<A<π])//Timing

Simplify[area,a>0&&b>0&&0<A<π]//Timing

Integrate

Assuming[assum,FullSimplify@Integrate[Boole[ineq],{x,-∞,∞},{y,-∞,∞}]]//Timing

RegionMeasure

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

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

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

AreaInertiaTensor

?AreaInertiaTensor

(i=AreaInertiaTensor[ineq,{x,y},Assumptions->assum])//Timing

i2=FullSimplify[i,assum]

pw=PiecewiseExpand[i,assum]

i3=pw/.HoldPattern[Piecewise[m_,d___]]:>Piecewise[Map[FullSimplify[#,assum]&,Select[m,FreeQ[#,Integrate]&],{2}],d]

Plot[Cos[A],{A,0,π/2}]

Subtract@@Most/@i3[[1]][[{1,3}]]

FullSimplify[i3[[1,1,1]],assum]

FullSimplify[%/.{A->π/2,a->a/2,b->b/2}]

LaminaData["FilledQuarterSquare","AreaInertiaTensor"]

"AreaMomentOfInertiaTensor" -> Function[{a, b}, {{(a b^3)/48,-(1/64) a^2 b^2},{-(1/64) a^2 b^2,(a^3 b)/48}}],

Centroid

V8

(centroid=(1/(a b Sin[A]))Integrate[{x,y}Boole[ineq[x,y]],{x,-∞,∞},{y,-∞,∞},Assumptions->a>0&&b>0&&0<A<π])//Timing

Simplify[centroid,a>0&&b>0&&0<A<π]//Timing

p=Cases[centroid[[1]],HoldPattern[Piecewise[x__]]:>x,{1,∞}][[1]]

Piecewise[px=FullSimplify[Most[p],a>0&&b>0&&0<A<π]]

FullSimplify[(1/2) a b (b+a Cos[A]) Sin[A]-#[[1]],#[[2]]]&/@px//Column

p2=Cases[centroid[[2]],HoldPattern[Piecewise[x__]]:>x,{1,∞}][[1]]

Piecewise[py=FullSimplify[Most[p2],a>0&&b>0&&0<A<π]]

FullSimplify[(1/2) (a^2) b ((Sin[A])^2)-#[[1]],#[[2]]]&/@py//Column

FullSimplify[{(1/(a b))Csc[A](1/2) a b (b+a Cos[A]) Sin[A],(1/(a b))Csc[A](1/2) (a^2) b ((Sin[A])^2)},a>0&&b>0&&0<A<π]

Block[{b=.2,a=.2,A=90Degree},
Show[{
RegionPlot[ineq[x,y],{x,Min[0, a Cos[A]],Max[b,b+a Cos[A]]},{y,0,a Sin[A]},AspectRatio->Automatic],
Graphics[Point[{(1/2) (b+a Cos[A]),(1/2) a Sin[A]}]]
}]
]

RegionCentroid

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

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

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

Inradius