Page **1** of **1**

### project a polytope

Posted: **28 May 2019, 22:21**

by **chocoffee**

Hi all,

I am trying to get the projection of a given polytope V with new m-dimensional variables y=Ex+f. Here x is the n-dimensional variable vector of the polytope V. E is a m*n matrix. I am wondering if I can get the projection by polymake. Thank you!

### Re: project a polytope

Posted: **01 Jun 2019, 18:51**

by **gawrilow**

I guess, all you need is to multiply the vertices of your input polytope with the transformation matrix, isn't it?

Taking care of the 0-th homogeneous coordinate:

Code: Select all

```
$tr=(1|$f)/(zero_vector<Rational>()|transpose($E));
$Vproj=new Polytope<Rational>(POINTS => $V->VERTICES * $tr);
```

Replace Rational with an appropriate coordinate type if necessary.

### Re: project a polytope

Posted: **08 Jun 2019, 15:14**

by **Collars**

Does replacing the Rational mess with anything else, Gawrilow?

### Re: project a polytope

Posted: **10 Jun 2019, 12:02**

by **gawrilow**

The choice of coordinate data type does not mess with anything, it should just reflect the nature of your input. Rational is the default choice in polymake, and this is appropriate in most standard cases. Float is also supported, but the outcome of many computations is not that reliable because of unavoidable rounding issues. You may try it out if your input is already in floating-point, but you can also switch to Rational, the numbers will be converted automatically.