Ask Your Question
0

multiplication of a polytope

asked 2021-06-04 19:04:27 +0100

Cyrille gravatar image

I answering to my question https://ask.sagemath.org/question/57371/how-to-transform-a-derived-set-of-inequation-in-the-good-polyhedron-format/ tmonteil gives me the very nice code

D = polytopes.dodecahedron()
M = matrix([[0,1,0],[0,0,1]])
(M * D).plot()

which do so simply what I was expecting. But as I am curious, I would like to know what is the internal representation of the polyhedra wich permit such product. Hope this is not a too stupid question with a self evident answer.

A second question is : how to translate D in the 3D space ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-06-04 19:21:42 +0100

tmonteil gravatar image

updated 2021-06-04 19:32:31 +0100

Regarding your first question, Sage relies on various libraries to represent and deal with polyhedras, so there are various corresponding backends, like ppl, cdd, normaliz, polymake. In the case of your docahedron, the backend is named field, which means that it relies on Sage own code, not external library:

sage: D.backend()
'field'

Now, to see the corresponding source code, you can do:

sage: from sage.geometry.polyhedron.backend_field import Polyhedron_field
sage: Polyhedron_field??

As you can see, the internal representation of your polyhedron is both the V-reprentation and the H-representation, simultaneously. In both cases, it is pretty easy so see how a matrix acts on them.

Regarding your second question, D is already a subset of some 3d space :

sage: D.ambient_space()
Vector space of dimension 3 over Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?
edit flag offensive delete link more

Comments

Maybe the second question was really: how to apply a translation to D, ie translate it by some vector.

Indeed, M * D takes care of applying a linear map, but for affine maps one also needs translations.

slelievre gravatar imageslelievre ( 2021-06-04 22:11:36 +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: 2021-06-04 19:04:27 +0100

Seen: 951 times

Last updated: Jun 04 '21