Ask Your Question
1

plotting 3d polytope in R^4

asked 2016-11-23 14:27:10 -0600

EmersonL gravatar image

updated 2017-01-05 15:23:43 -0600

FrédéricC gravatar image

I'm trying to plot the following polytope on the cloud:

P=Polyhedron(vertices=[[0, 1, 0, 4] , [0, 1, 1, 3] , [3, 1, 1, 0] , [3, 1, 0, 1] , [0, 3, 0, 2] , [0, 3, 1, 1] , [1, 0, 0, 4] , [1, 0, 1, 3] , [3, 0, 1, 1] , [3, 0, 0, 2] , [1, 3, 1, 0] , [1, 3, 0, 1]])
P.plot()

This is a polytope living in R^4, but in fact the sum of the coordinates of each vertex is 5, so it is a 3D polytope. In some cases, sage gives me a nice 3D view of how the polytope looks like, but in this case it gives me something that doesn't even looks convex, so it is not the right projection. I would like to know what is going on and try to solve this issue, so I appreciate ideas on how to correct this, and where to look at on the code.

edit retag flag offensive close merge delete

Comments

Maybe setting projection_direction when calling the plot method could help.

fidbc gravatar imagefidbc ( 2016-11-23 15:55:18 -0600 )edit

I tried different projection directions, and always the plot seems to have the same non-convexity issues. I guess there is something wrong with these projections.

EmersonL gravatar imageEmersonL ( 2016-11-29 17:47:24 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2016-11-23 19:01:52 -0600

tmonteil gravatar image

You can let your polytope live in its affine hull, which is 3-dimensional:

sage: P.affine_hull().plot()
edit flag offensive delete link more

Comments

1

The documentation of affine_hull should be more specific telling what is the output polyhedron, and in which sense it is the same as the original one. As I see, in this example it is a projection to the first 3 coordinates, but it is not similar to the original one, but only affinely equivalent.

EmersonL gravatar imageEmersonL ( 2016-11-29 17:45:53 -0600 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-11-23 14:27:10 -0600

Seen: 56 times

Last updated: Nov 23 '16