Ask Your Question
2

plotting 3d polytope in R^4

asked 2016-11-23 21:27:10 +0100

EmersonL gravatar image

updated 2017-01-05 22:23:43 +0100

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 22:55:18 +0100 )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-30 00:47:24 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2016-11-24 02:01:52 +0100

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-30 00:45:53 +0100 )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 21:27:10 +0100

Seen: 590 times

Last updated: Nov 24 '16