Tag Info

Hot answers tagged

4

In version 10, you can use MeshCoordinates[ConvexHullMesh[...]] as in RunnyKine's answer, but you need to re-order them using MeshCells: pentagon=N@Table[{Cos[2 Pi k /5], Sin[2 Pi k /5]}, {k, 5}] points = N@RandomSample[Join[pentagon, {{0, 0}}]] chm=ConvexHullMesh[points]; ordering=MeshCells[chm,2][[1,1]] out=MeshCoordinates[chm][[ordering]] ...


3

If you have Version 10, you could use ConvexHullMesh. pts = RandomReal[{-10, 10}, {6, 2}]; You can then order them by doing: chull = ConvexHullMesh[pts]; And here are the points: MeshCoordinates[chull] Note: This does not always order the points but one can use MeshCells which will give the ordering correctly. See @kguler's answer.


2

Could use ConvexHull in the ComputationalGeometry standard add-on package. Needs["ComputationalGeometry`"] We'll create a simple example. pts = RandomReal[{-10, 10}, {6, 2}]; ListPlot[Append[pts, First[pts]], Joined -> True] Now find and plot the (ordered) outer points. hullindices = ConvexHull[pts]; hullpts = pts[[hullindices]]; ...


1

The following works in your special case but can't be generalized. l = {"+", "m", "π", "[]", "2"}; SeedRandom@0; rl = RandomSample[l, 5]; g = With[{cg = CycleGraph[5]}, Graph[UndirectedEdge @@@ Thread@{rl, RotateLeft@rl}, VertexCoordinates -> (Rule @@@ Thread@{rl, VertexCoordinates /. AbsoluteOptions[cg, VertexCoordinates]}), ...



Only top voted, non community-wiki answers of a minimum length are eligible