Contents
Example session
In order not to stretch the imagination of the reader too far,
we will not pass beyond dimension 3.
After invoking Maple, we first have to load the package:
Warning, the name polar has been redefined
[affinehull, ambientdim, arecompatible, boundary, codim, contains, containsrelint, convhull, corank, crosspolytope, cube, cyclicpolytope, delaunay, dim, directsum, distance, domain, dotprod, draw, dual, edges, emptypcomplex, emptypolyhedron, emptypolytope, facefan, faces, facets, fan, flagf, flagh, fullcone, fullpolyhedron, furthestdelaunay, fvector, genhpolynomial, genhvector, hilbertbasis, homology, hplanes, hspacenos, hspaces, hvector, image, incidencematrix, incidentfacets, incidentrays, intersection, isaffine, isbounded, iscomplete, iscontained, isempty, isface, isfulldim, islinear, ispointed, ispolytopal, isquasipolytopal, isregular, issimple, issimplex, issimplicial, issimplicial1, join, lensspace, lineality, linearhull, lines, maximal, maximum, minimal, minimum, minkowskisum, modz, normalfan, pcomplex, permutahedron, plotdata, polar, poshull, posorthant, pred, preimage, projspace, proximum, randompolytope, rank, raynos, rays, readpoly, recession, regularpart, regularsubdiv, relint, simplicialsubdiv, skeleton, stdsimplex, stellarsubdiv, succ, support, surface, torsion, transversalfan, traverse, traverse2, vertices, volume, voronoi, wprojspace, writepoly, zerocone, zerofan]
We start with a cube, which is a 3-fold Cartesian product of an
interval with itself.
(The package already provides functions to generate some standard polyhedra,
so this is just to illustrate the general principle.)
> |
P0 := convhull([-1], [1]);
|
P0 := POLYTOPE(1,1,2,2)
P1 := POLYTOPE(3,3,8,6)
The last line says that
P1
is a 3-dimensional polytope in 3-space with 8 vertices and 6 facets.
We also take its dual (which is an octahedron) and scale it by 3/2.
> |
P2 := image(dual(P1), 3/2);
|
P2 := POLYTOPE(3,3,6,8)
As was to be expected, it has 8 facets and 6 vertices.
What are they?
[[2, 2, 2] <= 3, [2, 2, -2] <= 3, [2, -2, 2] <= 3, [2, -2, -2] <= 3, [-2, 2, 2] <= 3, [-2, 2, -2] <= 3, [-2, -2, 2] <= 3, [-2, -2, -2] <= 3]
[[-3/2, 0, 0], [3/2, 0, 0], [0, -3/2, 0], [0, 3/2, 0], [0, 0, -3/2], [0, 0, 3/2]]
So it is indeed an octahedron.
Next we compute the intersection of these two polytopes.
> |
P3 := intersection(P1, P2);
|
P3 := POLYTOPE(3,3,24,14)
We see that no facet was lost.
[[1/2, 1, 0], [1, 1/2, 0], [1/2, 0, 1], [1, 0, 1/2], [1/2, 0, -1], [1, 0, -1/2], [1/2, -1, 0], [1, -1/2, 0], [0, 1, 1/2], [0, 1/2, 1], [0, 1, -1/2], [0, 1/2, -1], [-1, 1/2, 0], [-1/2, 1, 0], [0, -1/2, 1], [0, -1, 1/2], [-1/2, 0, 1], [-1, 0, 1/2], [0, -1/2, -1], [0, -1, -1/2], [-1/2, 0, -1], [-1, 0, -1/2], [-1/2, -1, 0], [-1, -1/2, 0]]
(By the way, this polytope is a 3-dimensional permutahedron.)
What is its (Euclidean) volume and surface?
4
6*3^(1/2)+3
Polytopes can also be drawn:
We now pass to fans and define the face fan of
P3.
This is just the collection of cones (with apex the origin)
spanned by the faces of
P3.
F := FAN(3,3,0,24,[0, 0, 14])
Of course, it has 24 rays and 14 maximal cones, all of dimension 3.
This fan should be complete, i.e., the union of all its cones should be
the whole space.
true
What is the smallest cone in this fan containing the given vector?
> |
C := support(F, [1,1,1]);
|
C := FANCONE(3,3,0,6,6)
This is a pointed 3-dimensional cone in 3-space with 6 rays and 6 facets.
What are its minimal integer ray representatives and inward facet normals?
[[1, 2, 0], [2, 1, 0], [1, 0, 2], [2, 0, 1], [0, 2, 1], [0, 1, 2]]
[[0, 0, 1], [0, 1, 0], [1, 0, 0], [-1, 2, 2], [2, -1, 2], [2, 2, -1]]
By the way, what are the facets?
fl := [CFACE(2,1), CFACE(2,1), CFACE(2,1), CFACE(2,1), CFACE(2,1), CFACE(2,1)]
We finally take a look at the face lattice of
C.
We choose two facets,
> |
f1 := fl[1];
f2 := fl[5];
|
f1 := CFACE(2,1)
f2 := CFACE(2,1)
and compute their minimum in the face lattice:
f3 := CFACE(1,2)
1
[[1, 2, 0]]
If we want to use
f3
as an ordinary cone, we simply convert it:
FANCONE(3,1,0,1,1)