# triangulate -- computes a triangulation of a polytope

## Synopsis

• Usage:
L = triangulate P
• Inputs:
• P, , , which must be compact
• Outputs:
• L, a list, containing the simplices of the triangulation

## Description

triangulate computes the triangulation of the polyhedron P, if it is compact, i.e. a polytope, recursively. For this, it takes all facets and checks if they are simplices. If so, then it takes the convex hull of these with the weighted centre of the polytope (the sum of the vertices divided by the number of vertices). For those that are not simplices it takes all their facets and does the same for these.

 i1 : P = hypercube 2 o1 = {ambient dimension => 2 } dimension of lineality space => 0 dimension of polyhedron => 2 number of facets => 4 number of rays => 0 number of vertices => 4 o1 : Polyhedron i2 : triangulate P o2 = {{| -1 |, | -1 |, 0}, {| 1 |, | 1 |, 0}, {| -1 |, | 1 |, 0}, {| -1 |, | -1 | | 1 | | -1 | | 1 | | -1 | | -1 | | 1 | ------------------------------------------------------------------------ | 1 |, 0}} | 1 | o2 : List

## Ways to use triangulate :

• "triangulate(Polyhedron)"

## For the programmer

The object triangulate is .