| 1 | initial version |
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.
| 2 | No.2 Revision |
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).
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.