from application polytope
Visualization of a polytope as a graph (if 1d), or as a solid object (if 2d or 3d), or as a Schlegel diagram (4d).
DIRECTED_GRAPH(LinearProgram lp)
Illustrate the behavior of a linear objective function on the polytope. Superpose the drawing with the directed graph induced by the objective function.
LinearProgram
lp
: a Linear Program object attached to the polytope
Attaches a linear program to the 3-dimensional cube and visualizes the directed graph, giving the cube a blue facet color
> $p = cube(3); > $p->LP = new LinearProgram(LINEAR_OBJECTIVE=>[0,0,0,1]); > $p->VISUAL(FacetColor=>"blue")->DIRECTED_GRAPH;
LATTICE()
Visualize the LATTICE_POINTS
of a polytope
Visual::PointSet::decorations
Visualizes the lattice points of the threedimensional cube.
> cube(3)->VISUAL->LATTICE;
LATTICE_COLORED()
Visualize the LATTICE_POINTS
of a polytope in different colors (interior / boundary / vertices)
Visual::PointSet::decorations
Creates the threedimensional unit cube scaled by 1.5 and displays the colored version of its lattice points
> cube(3,(3/2),0)->VISUAL->LATTICE_COLORED;
MIN_MAX_FACE(LinearProgram lp)
Illustrate the behavior of a linear objective function on the polytope. Draw the facets contained in MAXIMAL_FACE
and MINIMAL_FACE
in distinct colors.
LinearProgram
lp
: a LinearProgram object attached to the polytope.
Color
min
: minimal face decoration (default: yellow vertices and/or facets)
Color
max
: maximal face decoration (default: red vertices and/or facets)
Attaches a linear program to the threedimensional cube and displays the minimal/maximal faces in a different color, choosing purple instead of the default red for the maximal face
> $p = cube(3); > $p->LP = new LinearProgram(LINEAR_OBJECTIVE=>[0,1,0,0]); > $p->VISUAL->MIN_MAX_FACE(max=>"purple");
STEINER()
Add the STEINER_POINTS to the 3-d visualization. The facets become transparent.
Visual::PointSet::decorations
Displays the Steiner points of a random threedimensional sphere with 20 vertices. The labels of the vertices are turned off.
> rand_sphere(3,20)->VISUAL(VertexLabels=>"hidden")->STEINER;
TRIANGULATION(Array<Set<Int>> t)
Add the triangulation to the drawing. You may specify any triangulation of the current polytope. Per default, the TRIANGULATION property is taken. (Currently there is only one possible alternative triangulation: TRIANGULATION_INT). Hint: Use the method Method → Effect → Explode Group of Geometries of JavaView for better insight in the internal structure.
Visual::Polygons::decorations
Displays a triangulation of the threedimensional cube. Facets are made transparent and vertices are hidden.
> cube(3)->VISUAL->TRIANGULATION(FacetTransparency=>0.7,VertexStyle=>"hidden");
TRIANGULATION_BOUNDARY()
Draw the edges of the TRIANGULATION_BOUNDARY. The facets are made transparent.
Visual::Graph::decorations
Displays the boundary triangulation of the threedimensional cube.
> cube(3)->VISUAL->TRIANGULATION_BOUNDARY;
For a slightly different visualization of essentially the same:
> cube(3)->TRIANGULATION->BOUNDARY->VISUAL;
VERTEX_COLORS(LinearProgram lp)
Illustrate the behavior of a linear objective function on the polytope. Color the vertices according to the values of the objective function.
LinearProgram
lp
: a LinearProgram object attached to the polytope
Color
min
: minimal vertex color (default: yellow)
Color
max
: maximal vertex color (default: red)
Attaches a linear program to the threedimensional cube and displays the minimal/maximal vertices in a different color, choosing purple instead of the default red for the maximal vertices
> $p = cube(3); > $p->LP = new LinearProgram(LINEAR_OBJECTIVE=>[0,1,0,0]); > $p->VISUAL->VERTEX_COLORS(max=>"purple");