Ask Your Question

Intersection of a Cube with two planes and resulting polyhedron

asked 2013-02-18 17:21:51 -0500

assadabbasi gravatar image

updated 2013-02-18 22:31:10 -0500

ppurka gravatar image


I am new to sage and trying to solve a problem where I have two planes cutting a cube. How can I find the resulting polytope/polyhedron as a result of this cut.

cube = polytopes.n_cube(3)

plane1 = Polyhedron(eqns=[(0,1,0,0)])
plane2 = Polyhedron(eqns=[(1,0,0,-1)])

Please also tell me that what is meant by eqns=[(0,1,0,0)] in sage? what equality it represent? similarly eqns=[(1,0,0,-1)] ?


edit retag flag offensive close merge delete


The last example in the documentation might be useful to understand what `eqns` means.

fidbc gravatar imagefidbc ( 2013-02-19 02:49:11 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2013-02-19 10:03:01 -0500

twch gravatar image

For an answer of the interpretation of eqns see your first post.

in order to calculate the intersection of your two planes and the cube, you can simply put all conditions in a new Polyhedron

cube = polytopes.n_cube(3)
plane1 = Polyhedron(eqns=[(0,1,0,0)])
plane2 = Polyhedron(eqns=[(1,0,0,-1)])
intersec=Polyhedron(eqns=plane1.equations()+plane2.equations(), ieqs=cube.inequalities())
print intersec.Hrepresentation()
edit flag offensive delete link more

answered 2013-02-20 11:01:10 -0500

assadabbasi gravatar image

Thank you very much. Your explanation was very useful in solving my problem.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-02-18 17:21:51 -0500

Seen: 539 times

Last updated: Feb 20 '13