Hexagon Triangle Picking

Author

Eric W. Weisstein
February 6, 2005

This notebook downloaded from http://mathworld.wolfram.com/notebooks/ComputationalGeometry/HexagonTrianglePicking.nb.

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

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

Exact

With[{ω=2π/6,n=6},
((9((Cos[ω])^2)+52Cos[ω]+44)/(36(n^2)((Sin[ω])^2)))]//FullSimplify

N[289/3888,10]

Inequalities

FullSimplify[Solve[1==6/2R^2Sin[2Pi/6],R]]

ineq[x_,y_]:=Inequalities[RegularPolygon[6],{x,y}]

ineq[x,y]//InputForm

<<Graphics`InequalityGraphics`

InequalityPlot[ineq[x,y],{x},{y}]

Monte Carlo Distribution

StandardDeviationOfMean[l_]:=Sqrt[Variance[l]/Length[l]]
StandardDeviationOfVariance[l_]:=Module[{n=Length[l]},
Sqrt[(n-1)^2/n^3(Plus@@((l-Mean[l])^4)/n)-(n-1)(n-3)Variance[l]^2/n^3]
]

Length[tris=Partition[Select[Table[Random[Real,{-1,1}],{10^6},{2}],ineq@@#&],3]]//Timing

Show[Graphics[{ClosedLine@@RegularPolygon[6],Red,PointSize[.02],Map[Point,Take[tris,10^3],{2}]}],
AspectRatio->Automatic,PlotRange->All]

FullSimplify[(((((Sqrt[2])/(3^(3/4)))))^4)]

areas=Area[Evaluate[Triangle[#]]]&/@tris/Area[Evaluate[RegularPolygon[6]]];//Timing

Partition[Through[{Mean,StandardDeviationOfMean,Variance,StandardDeviationOfVariance}[areas]],2]

<<Graphics`Graphics`

BarChart[Length/@Split[Ceiling[300Sort[areas]]],Ticks->None,BarEdges->None,BarSpacing->-.2,AxesLabel->TraditionalForm/@{A,P[A]}]