First time here? Check out the FAQ!

Ask Your Question
2

plotting 3d polytope in R^4

asked 8 years ago

EmersonL gravatar image

updated 8 years ago

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.

Preview: (hide)

Comments

Maybe setting projection_direction when calling the plot method could help.

fidbc gravatar imagefidbc ( 8 years ago )

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 ( 8 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 8 years ago

tmonteil gravatar image

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

sage: P.affine_hull().plot()
Preview: (hide)
link

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 ( 8 years ago )

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: 8 years ago

Seen: 617 times

Last updated: Nov 24 '16