| Hosted by CoCalc | Download
Kernel: SageMath (latest)

Sage polyhedron_tools

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)
Image in a Jupyter notebook
asph, x_asph = asphericity_polytope(P) print 'The asphericity of P is : ', asph, ', with center of asphericity ', x_asph
The asphericity of P is : 1.4358905491 , with center of asphericity (0.0020738353463811902, 0.0011433410719341656)