https://github.com/mforets/polyhedron_tools

Package for working with polytopes in SageMath, with a focus on computational geometry.

from polyhedron_tools.polygons import random_polygon_2d from polyhedron_tools.misc import BoxInfty from polyhedron_tools.asphericity import asphericity_polytope, circumradius, inradius

P = random_polygon_2d(20) from polyhedron_tools.misc import chebyshev_center x0 = chebyshev_center(P) P.plot(alpha=0.2, color='green') + point(x0)

asph, x_asph = asphericity_polytope(P) print 'The asphericity of P is : ', asph, ', with center of asphericity ', x_asph