Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
user_guide:tutorials:apps_polytope [2019/01/25 09:38] – ↷ Links adapted because of a move operation oroehrig | user_guide:tutorials:apps_polytope [2019/01/29 21:46] – external edit 127.0.0.1 |
---|
A //polytope// is the convex hull of finitely many points in some Euclidean space. Equivalently, a polytope is the bounded intersection of finitely many affine halfspaces. ''polymake'' can deal with polytopes in both representations and provides numerous tools for analysis.\\ | A //polytope// is the convex hull of finitely many points in some Euclidean space. Equivalently, a polytope is the bounded intersection of finitely many affine halfspaces. ''polymake'' can deal with polytopes in both representations and provides numerous tools for analysis.\\ |
| |
This tutorial first shows basic ways of defining a polytope from scratch. For larger input (e.g. from a file generated by some other program) have a look at [[..:data|how to load data]] in ''polymake''.\\ | This tutorial first shows basic ways of defining a polytope from scratch. For larger input (e.g. from a file generated by some other program) have a look at [[..:howto:data|how to load data]] in ''polymake''.\\ |
| |
The second part demonstrates some of the tool ''polymake'' provides for handling polytopes by examining a small example. For a complete list of properties of polytopes and functions that ''polymake'' provides, see the [[reldocs>3.0/polytope.html|polytope documentation]]. | The second part demonstrates some of the tool ''polymake'' provides for handling polytopes by examining a small example. For a complete list of properties of polytopes and functions that ''polymake'' provides, see the [[reldocs>3.0/polytope.html|polytope documentation]]. |
| |
==== V-Description ==== | ==== V-Description ==== |
To define a polytope as the convex hull of finitely many points, you can pass a matrix of coordinates to the constructor. Since ''polymake'' uses [[user_guide:coordinates|homogeneous coordinates]], you need to set the additional coordinate x<sub>0</sub> to 1. | To define a polytope as the convex hull of finitely many points, you can pass a matrix of coordinates to the constructor. Since ''polymake'' uses [[user_guide:tutorials:coordinates|homogeneous coordinates]], you need to set the additional coordinate x<sub>0</sub> to 1. |
<code> | <code> |
polytope > $p = new Polytope(POINTS=>[[1,-1,-1],[1,1,-1],[1,-1,1],[1,1,1],[1,0,0]]); | polytope > $p = new Polytope(POINTS=>[[1,-1,-1],[1,1,-1],[1,-1,1],[1,1,1],[1,0,0]]); |
It is also possible to define a polytope as an intersection of finitely many halfspaces, i.e., a matrix of inequalities.\\ | It is also possible to define a polytope as an intersection of finitely many halfspaces, i.e., a matrix of inequalities.\\ |
| |
An inequality a<sub>0</sub> + a<sub>1</sub> x<sub>1</sub> + ... + a<sub>d</sub> x<sub>d</sub> >= 0 is encoded as a row vector (a<sub>0</sub>,a<sub>1</sub>,...,a<sub>d</sub>), see also [[user_guide:coordinates|Coordinates for Polyhedra]]. Here is an example: | An inequality a<sub>0</sub> + a<sub>1</sub> x<sub>1</sub> + ... + a<sub>d</sub> x<sub>d</sub> >= 0 is encoded as a row vector (a<sub>0</sub>,a<sub>1</sub>,...,a<sub>d</sub>), see also [[user_guide:tutorials:coordinates|Coordinates for Polyhedra]]. Here is an example: |
<code> | <code> |
polytope > $p4 = new Polytope(INEQUALITIES=>[[1,1,0],[1,0,1],[1,-1,0],[1,0,-1],[17,1,1]]); | polytope > $p4 = new Polytope(INEQUALITIES=>[[1,1,0],[1,0,1],[1,-1,0],[1,0,-1],[17,1,1]]); |