View source: R/rotate_polytope.R
rotate_polytope | R Documentation |
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 T
.
rotate_polytope(P, rotation = list())
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. |
Let P
be the given polytope and Q
the rotated one and T
be the matrix of the linear transformation.
If P
is in H-representation and A
is the matrix that contains the normal vectors of the facets of Q
then AT
contains the normal vactors of the facets of P
.
If P
is in V-representation and V
is the matrix that contains column-wise the vertices of Q
then T^TV
contains the vertices of P
.
If P
is a zonotope and G
is the matrix that contains column-wise the generators of Q
then T^TG
contains the generators of P
.
If M
is a matrix that contains column-wise points in Q
then T^TM
contains points in P
.
A list that contains the rotated polytope and the matrix T
of the linear transformation.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.