Regular Hexagon

Author

Eric W. Weisstein
July 3, 2018

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

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

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

Code

Hexagon::usage="Hexagon[{a, b, c}, {t1, t2}] gives a hexagon with side lengths {a,b,c,a,b,c} and opening angles {t1,-t2}."

HexagonTriangles::usage="HexagonTriangles[{v1,...,v6}] gives the two congruent triangles obtained by taking each three sides and drawing a fourth point to make a parallelogram."

Hexagon[{a_,b_,c_},{t1_,t2_}]:=Module[{aa=a{Cos[t1],Sin[t1]},bb=b{Cos[t2],-Sin[t2]},cc=c{0,-1}},Line[FoldList[Plus,{0,0},{aa,bb,cc,-aa,-bb,-cc}]]]

HexagonTriangles[a_List/;Length[a]==6]:=Module[{l=Join[a,Take[a,3]],i,p},p=Table[l[[i+2]]+l[[i]]-l[[i+1]],{i,6}];
{{PointSize[.03],Point/@p},ClosedLine[p[[{1,3,5}]]],Triangle[p[[{2,4,6}]]]}]

Definitions

ineq=Sqrt[3] a≥Sqrt[3] x+y&&Sqrt[3] a≥2 y&&Sqrt[3] (a+x)≥y&&Sqrt[3] a+Sqrt[3] x+y≥0&&Sqrt[3] a+2 y≥0&&Sqrt[3] a+y≥Sqrt[3] x;

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

verts=a{{1,0},{1/2,Sqrt[3]/2},{-(1/2),Sqrt[3]/2},{-1,0},{-(1/2),-(Sqrt[3]/2)},{1/2,-(Sqrt[3]/2)}};

reg=Polygon[verts];

assum=a>0;

Figure

Show[LaminaData["FilledRegularHexagon","Diagram"],ImageSize->300]

Diagrams

Diagram

LaminaData["FilledRegularHexagon","Diagram"]

DiscretizeRegion

Block[{a=1},DiscretizeRegion[#]]&/@{reg,implreg}

RegionPlot

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

Polygon

Graphics[RegularPolygon[6]]

InequalityPlot

<<Graphics`InequalityGraphics`
<<Utilities`Typesetting`

InequalityPlot[#<1.,{x},{y},Ticks->None,PlotLabel->TraditionalForm[#<1]]&[2 Abs[x]+Abs[x-(Sqrt[3]) y]+Abs[x+(Sqrt[3]) y]]

Properties

TableForm[RegularPolygonInformation[6]//Simplify,TableDepth->2]//TraditionalForm

Equations

Inequality

RegularPolygon[6,1]

ineq=FullSimplify[Inequalities[RegularPolygon[6,a],{x,y}],a>0]/.Greater->GreaterEqual

ineq[x_,y_]:=(Sqrt[3]) a≥(Sqrt[3]) x+y&&(Sqrt[3]) a≥2 y&&(Sqrt[3]) (a+x)≥y&&(Sqrt[3]) a+(Sqrt[3]) x+y≥0&&(Sqrt[3]) a+2 y≥0&&(Sqrt[3]) a+y≥(Sqrt[3]) x

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

Properties

Area

Area

Assuming[assum,FullSimplify[Area[reg/.a->1]]]//Timing

Assuming[assum,FullSimplify[Area[implreg/.a->1]]]//Timing

Integrate

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

RegionMeasure

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

Assuming[assum,FullSimplify[RegionMeasure[reg/.a->1]]]

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

AreaInertiaTensor

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

Centroid

Integrate

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

RegionCentroid

Assuming[assum,FullSimplify[RegionCentroid[reg/.a->1]]]//Timing

Assuming[assum,FullSimplify[RegionCentroid[implreg/.a->1]]]//Timing

Diagonals

Length[v={{1,0},{1/2,Sqrt[3]/2},{-(1/2),Sqrt[3]/2},{-1,0},{-(1/2),-(Sqrt[3]/2)},{1/2,-(Sqrt[3]/2)}}]

ds=With[{n=Length[v]},Select[Subsets[Range[n],{2}],Mod[Subtract@@#,n]≠n-1≠1&]]

Length[%]

FullSimplify[Binomial[n,2]-n]

n(n-3)/2/.n->Length[v]

Graphics[{
{Yellow,Opacity[.2],EdgeForm[Black],Polygon[v]},
Line[ds]/.Thread[Range[Length[v]]->v]
}]

SortBy[FullSimplify@RootReduce[Norm[Subtract@@v[[#]]]&/@ds],N]

EdgeLengths

s=FullSimplify[Norm/@(Subtract@@@Partition[verts,2,1,1]),assum]

GeneralizeDiameter

GD[n_]:=If[OddQ[n],(1/2) Csc[(π/(2 n))],Csc[(π/n)]]a

GD[6]//FunctionExpand//FullSimplify

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

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

...ran overnight...

Perimeter

Total[s]

RadiiOfGyration

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