Warning: There are no guarantees for the robustness of the GeoCalcLib! Please report any malfunction.

The permutahedron1 $\Pi_{d-1}\subseteq\mathbb R^d$ is given by the convex hull of all permutations of the coordinates of

$$\begin{pmatrix} 1 \\ 2 \\ \vdots \\ d \end{pmatrix}$$

It is easy to see that all such vectors satisfy

$$\begin{pmatrix} 1 && 1 && \cdots && 1 \end{pmatrix}x = \frac{d(d-1)}{2}$$

i.e. $\Pi_{d-1}\subseteq \{x\in\mathbb R^d: {\bf{1}}x= \frac{d(d-1)}{2}\}$ and therefore has a dimension of $d-1$.

We use $\Pi_3$ as an example. Naturally $\Pi_3$ is a 3-dimensional polytope embedded in $\mathbb R^4$, in order to visualise it we need to project it onto $\{x\in\mathbb R^d: {\bf{1}}x= \frac{d(d-1)}{2}\}$. This can easily be done using a QR decomposition of ${\bf{1}}^T$. If $QR={\bf{1}}^T$ then $Q^Tv_i$ rotates $v_i$ in such a way that its first coordinate corresponds to $c\frac{d(d-1)}{2}$. We can drop the first coordinate and study at the convex hull of 3-dimensional vectors.

In Matlab we can use

Assume now we want to perform a projective transformation, that is we want to intersect the homogenisation of $\Pi_3$ with a hyperplane $H = \{x\in\mathbb R^4 : ax = b\}$. Since $\text{homog}(\Pi_3)$ is a cone in $\mathbb R^4$ simply rotating $\text{vert}(\text{homog}(\Pi_3))$ using a QR decomposition of $a^T$ and discarding the first coordinates would yield $\mathbb R^3$.

Therefore we use a facet enumeration of $\Pi_3$ to produce $\text{homog}(\Pi_3)$, with that we will enumerate the vertices of

$$T(\Pi_3,H) = \{x\in\mathbb R^4: x\in\text{homog}(\Pi_3)\wedge x\in H\}$$

Naturally $\text{vert}(T(\Pi_3,H))\in H$ such that we can again project them by using a QR decomposition.

For the numerical example assume $% $. We use the following Matlab code:

1. G. M. Ziegler - Lectures on Polytopes