next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Polyhedra :: faces

faces -- computes all faces of a certain codimension of a Cone or Polyhedron

Synopsis

Description

faces computes the faces of codimension k of the given Cone or Polyhedron, where k must be between 0 and the dimension of the second argument. The faces will be of the same class as the original convex object. If the parameterkis omitted,faces will return a HashTable containing the faces with the codimensions as keys.

For example, we can look at the edges of the cyclicPolytope with 5 vertices in 3 space

i1 : P = cyclicPolytope(3,5)

o1 = P

o1 : Polyhedron
i2 : L = faces(2,P)

o2 = {({0, 2}, {}), ({1, 2}, {}), ({0, 1}, {}), ({0, 3}, {}), ({2, 3}, {}),
     ------------------------------------------------------------------------
     ({3, 4}, {}), ({0, 4}, {}), ({2, 4}, {}), ({1, 4}, {})}

o2 : List

Since this is only a list of polyhedra we look at their vertices:

i3 : vertP = vertices P

o3 = | 0 1 2 3  4  |
     | 0 1 4 9  16 |
     | 0 1 8 27 64 |

              3        5
o3 : Matrix QQ  <--- QQ
i4 : apply(L, f -> vertP_(f#0))

o4 = {| 0 2 |, | 1 2 |, | 0 1 |, | 0 3  |, | 2 3  |, | 3  4  |, | 0 4  |, | 2
      | 0 4 |  | 1 4 |  | 0 1 |  | 0 9  |  | 4 9  |  | 9  16 |  | 0 16 |  | 4
      | 0 8 |  | 1 8 |  | 0 1 |  | 0 27 |  | 8 27 |  | 27 64 |  | 0 64 |  | 8
     ------------------------------------------------------------------------
     4  |, | 1 4  |}
     16 |  | 1 16 |
     64 |  | 1 64 |

o4 : List

Ways to use faces :