Convex Polygon

Author

Eric W. Weisstein
September 12, 2005

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

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

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

Examples

2-D

Show[GraphicsArray[Graphics[#,PlotRange->{{-1,1},{-1,1}},
AspectRatio->Automatic]&/@{
Line[Table[{Sin[#],Cos[#]}&[2Pi i/5],{i,0,5}]],
Line[Table[If[Mod[i,5]==0,.0,1]{Sin[#],Cos[#]}&[2Pi i/5],{i,0,5}]]
}]]

3-D

p4=Polygon[{{0,0,0},{1,0,0},{0,1,0},{1,1,0}}]

Show[GraphicsArray[Graphics3D/@{p4,Convexify[p4]}]]

c[v3-v1,v2-v1]

c@@({v3,v2}-v1)

p5=Polygon[Table[{Cos[2Pi i/5],Sin[2Pi i/5],0},{i,0,4}][[RandomPermutation[5]]]];

Show[GraphicsArray[Graphics3D/@{p5,Convexify[p5]}]]

Pentagram in 3-D

<<PolygonTriangulation`SimplePolygonTriangulation`
<<Graphics`Shapes`

pentagram=Table[{Sin[2Pi i/5],Cos[2Pi i/5],0},{i,1,9,2}];

Show[Graphics3D[Polygon[pentagram]]]

This code might be from Maeder?

Show[Graphics3D[{ConvexifiedPolygon[pentagram,5/2]}]]

Show[Graphics3D[{
ConvexifiedPolygon[pentagram,5/2],
ConvexifiedPolygon[RotateShape[Polygon[pentagram],0,.4,0][[1]],5/2]
}]]

Show[Graphics3D[Convexify[Table[{Sin[((2π k)/7)],Cos[((2π k)/7)],0},{k,1,14,2}],7/2]]]

poly=Table[{Sin[((π k)/7)],Cos[((π k)/7)],0}(2+Mod[k,2]),{k,14}];
rpoly=rotm[{1,2,3}].#& /@ N[poly];

Show[Graphics3D[Line[Append[rpoly,rpoly[[1]] ]] ]]

Show[Graphics3D[Polygon[poly] ],PlotRange->All]

Show[Graphics3D[ConvexifiedPolygon[rpoly] ]]

Show[Graphics3D[{Line[Append[rpoly,rpoly[[1]] ]],
EdgeForm[],ConvexifiedPolygon[rpoly]} ]]

ConvexifiedPolygon[{{.223919,1.,.974608},{-.303209,-.118304,.974608},{-1.01043,.17082,.974608},{.223919,.236068,.974608}}]

Show[Graphics3D[Convexify[Table[{Sin[2Pi i/5]+Random[],Cos[2Pi i/5],0},{i,1,9,2}],5/2]]]