Macaulay2 » Documentation
Packages » Polyhedra :: barycentricTriangulation
next | previous | forward | backward | up | index | toc

# barycentricTriangulation -- computes a triangulation of a polytope

- Usage:
    `L = barycentricTriangulation P`
- Inputs:
  - P, a convex polyhedron, , which must be compact
- Outputs:
  - L, a list, containing the simplices of the triangulation

## Description

barycentricTriangulation 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 = P

    o1 : Polyhedron

    i2 : barycentricTriangulation 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 barycentricTriangulation:

- `barycentricTriangulation(Polyhedron)`

## For the programmer

The object barycentricTriangulation is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Polyhedra/documentation/old_documentation.m2:2223:0.