Trying to plot a ConvexHull Using PlanarGraphPlot from the ComputationalGeometry package, it does not work when used in graphics.
Any Idea on how to plot the ConvexHull using Graphics ?
Needs["ComputationalGeometry`"]
pts = RandomReal[{0, 10}, {60, 2}];
Graphics[
{
Point@pts,
FaceForm[], EdgeForm[Red],
Polygon@pts[[ConvexHull[pts]]]
}
]
or
cpts = pts[[ConvexHull[pts]]];
AppendTo[cpts, cpts[[1]]];
Graphics[
{
Point@pts,
Red,
Line@cpts
}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With