Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You should give us the exact code you are using. Below is an example that does (if I am not mistaken) what you want:

sage: thePoints = [(9464.0, 10816.0),(8736.0, 7735.0), (7904.0, 8736.0), (11088.0, 5607.0),(15552.0, 6480.0),(8160.0, 9248.0),(8568.0, 9792.0),(11076.0, 10140.0),(12852.0, 5355.0)]
sage: hull = Polyhedron(vertices=thePoints)
sage: hull.vertices() # not in cyclic order
(A vertex at (7904, 8736),
 A vertex at (8160, 9248),
 A vertex at (8568, 9792),
 A vertex at (8736, 7735),
 A vertex at (9464, 10816),
 A vertex at (11076, 10140),
 A vertex at (11088, 5607),
 A vertex at (12852, 5355),
 A vertex at (15552, 6480))
sage: from sage.geometry.polyhedron.plot import cyclic_sort_vertices_2d
sage: cyclic_sort_vertices_2d(hull.vertices()) # in cyclic order
[A vertex at (15552, 6480),
 A vertex at (11076, 10140),
 A vertex at (9464, 10816),
 A vertex at (8568, 9792),
 A vertex at (8160, 9248),
 A vertex at (7904, 8736),
 A vertex at (8736, 7735),
 A vertex at (11088, 5607),
 A vertex at (12852, 5355)]