Ask Your Question

Revision history [back]

Hello,

The graphical objects are quite static (you can not use them for computations). If you would like to find intersections between several polyhedra you may use the object Polyhedron for which it is possible to compute intersections:

sage: P = Polyhedron([(0,0),(1,0),(2,2),(3,1)])
sage: Q = Polyhedron([(-1,-3),(1,1),(2,4),(4,-5)])
sage: Z = P.intersection(Q)
sage: Z.vertices_list()
[[18/7, 10/7], [27/10, 17/20], [1, 0], [2, 2], [1/2, 1/2], [2/7, 0]]

As intersection are as well polyhedra you may plot them as well.

Hello,

The graphical objects are quite static (you can not use them for computations). If you would like to find intersections between several polyhedra you may use the object Polyhedron for which it is possible to compute intersections:

sage: P = Polyhedron([(0,0),(1,0),(2,2),(3,1)])
sage: Q = Polyhedron([(-1,-3),(1,1),(2,4),(4,-5)])
sage: Z = P.intersection(Q)
sage: Z.vertices_list()
[[18/7, 10/7], [27/10, 17/20], [1, 0], [2, 2], [1/2, 1/2], [2/7, 0]]

As intersection of polyhedra are as well polyhedra you may plot them as well.

sage: Z.plot()

Note that in sage-5.9 there will be fine options to plot polyhedron (ticket #14175).