CoCalc Shared Filesscratch / polyhedron_tools.ipynbOpen in CoCalc with one click!
Authors: harald @schil.ly, Harald Schilly
Views : 15

Sage polyhedron_tools

https://github.com/mforets/polyhedron_tools

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

In [1]:
from polyhedron_tools.polygons import random_polygon_2d from polyhedron_tools.misc import BoxInfty from polyhedron_tools.asphericity import asphericity_polytope, circumradius, inradius
In [7]:
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)
In [11]:
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)
In [ ]: