Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
0

Intersection of a Cube with two planes and resulting polyhedron

asked 12 years ago

assadabbasi gravatar image

updated 12 years ago

ppurka gravatar image

Hi,

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)
cube.Hrepresentation()

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)] ?

Thanks

Preview: (hide)

Comments

The last example in the documentation might be useful to understand what `eqns` means. http://x0.no/apde

fidbc gravatar imagefidbc ( 12 years ago )

2 Answers

Sort by » oldest newest most voted
3

answered 12 years ago

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()
intersec.show()
Preview: (hide)
link

Comments

In a more recent version you can do:

sage: cube = polytopes.cube()
sage: plane1 = Polyhedron(eqns=[(0,1,0,0)])
sage: plane2 = Polyhedron(eqns=[(1,0,0,-1)])
sage: intersec = cube & plane1 & plane2
jipilab gravatar imagejipilab ( 5 years ago )
0

answered 12 years ago

assadabbasi gravatar image

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

Preview: (hide)
link

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 1,025 times

Last updated: Feb 20 '13