Linear inequality solving
The LinearSolve command in the RegularChains package, whose purpose is to solve systems of linear equations and inequalities, has been enhanced in several ways:
A more efficient algorithm based on Fourier-Motzkin elimination, has been implemented.
Two new options, canonical and projection, for controlling the form of the output have been added.
The examples below illustrate the use of this command and the two new options for computations with polyhedra.
Change of representation for polyhedra
There are at least two ways to mathematically describe a polyhedron, either by specifying its corners, or by specifying its bounding hyperplanes. This is illustrated using a cube of side length 1 with one corner at the origin and its three adjacent edges parallel to the three coordinate axes.
Plot the cube:
Define this cube by bounding planes:
Alternatively, define the vertices of the same cube:
Suppose now that you are given the vertex representation and want to automatically derive the bounding planes representation. The cube is defined as the convex hull of all its vertices:
You can now use the LinearSolve command to eliminate all λi from this system of equations and inequalities. The projection option is used to specify that elimination is required, and the canonical option to eliminate redundant equations and inequalities.
This agrees with the representation c1 above.
For every convex 3-D polyhedron, there is a dual polyhedron with the roles of corners and faces swapped. Let us compute the dual polyhedron of the cube. Start with a representation of the cube with the origin as the center.
Now rewrite this in matrix form.
In general, if a bounded convex polyhedron is given by a set of inequalities of the form B.v≤1, then the vertices of its dual are exactly the columns of the matrix B. The convex hull of these six vertices defines an octahedron. Using the same method as before, compute the bounding planes for this octahedron.
The first two inequalities represent that projection of the octahedron onto the x axis:
Together with the following four inequalities, which involve only x and y but not z, this defines the projection of the octahedron onto the x,y-plane:
The following plot shows this projection (blue) together with the four boundary lines.
Finally, the last 8 inequalities, i.e., the ones containing z, define the bounding planes of the octahedron.
The following 3-D plot displays the tetrahedron as well as the last of these 8 bounding planes. Rotate the plot with the mouse in order to see that the plane actually touches one of the faces.
Download Help Document