rotate_polytope {volesti} | R Documentation |
Apply a random rotation to a convex polytope (H-polytope, V-polytope, zonotope or intersection of two V-polytopes)
Description
Given a convex H- or V- polytope or a zonotope or an intersection of two V-polytopes as input, this function applies (a) a random rotation or (b) a given rotation by an input matrix .
Usage
rotate_polytope(P, rotation = list())
Arguments
P |
A convex polytope. It is an object from class (a) Hpolytope, (b) Vpolytope, (c) Zonotope, (d) intersection of two V-polytopes. |
rotation |
A list that contains (a) the rotation matrix T and (b) the 'seed' to set a spesific seed for the number generator. |
Details
Let be the given polytope and
the rotated one and
be the matrix of the linear transformation.
If
is in H-representation and
is the matrix that contains the normal vectors of the facets of
then
contains the normal vactors of the facets of
.
If
is in V-representation and
is the matrix that contains column-wise the vertices of
then
contains the vertices of
.
If
is a zonotope and
is the matrix that contains column-wise the generators of
then
contains the generators of
.
If
is a matrix that contains column-wise points in
then
contains points in
.
Value
A list that contains the rotated polytope and the matrix of the linear transformation.
Examples
# rotate a H-polytope (2d unit simplex)
P = gen_simplex(2, 'H')
poly_matrix_list = rotate_polytope(P)
# rotate a V-polytope (3d cube)
P = gen_cube(3, 'V')
poly_matrix_list = rotate_polytope(P)
# rotate a 5-dimensional zonotope defined by the Minkowski sum of 15 segments
Z = gen_rand_zonotope(3, 6)
poly_matrix_list = rotate_polytope(Z)