Test if a polyhedron/point is contained inside polyhedron.
tf = P.contains(S)
tf = P.contains(S, fastbreak)
tf = contains(P, S, fastbreak)
P > S
P >= S
S < P
S <= P
P |
polyhedron or an array of polyhedra with m elements Class: Polyhedron |
S |
Polyhedron or a polyhedron array or a set of points.
Multiple points must be concatenated in a matrix column-wise, where the number of rows corresponds to the dimension of P and
the number of columns gives the number of points to test.
No automatic transposition is performed!
Class: Polyhedron or double |
fastbreak |
A logical flag. If true it indicates that the set membership test should be terminated as soon as at least one element of P contains
the point S.
Class: logical Allowed values:
Default: 0 |
tf |
True if ![]()
Class: logical Allowed values:
|
P = ExamplePoly.poly3d_sin('d',3);
S = ExamplePoly.poly3d_sin('d',3); S = S.affineMap(eye(3)*2);Compare polytopes:
P.contains(S)
ans = 0
S.contains(P)
ans = 1Plot the result
plot([P,S],'alpha',0.3);
P = ExamplePoly.randHrep;
S = P + ExamplePoly.randVrep('n',1,'nr',1);Compare polytopes:
P.contains(S)
ans = 0
S.contains(P)
ans = 0Plot the result
plot([S P]);
P = ExamplePoly.randVrep;Grid the polyhedron with 5 point over dimension.
x = P.grid(5);Test whether each grid point is contained in the polyhedron P.
P.contains(x')
ans = 1 1 1 1 1 1 1 1
◀ | isneighbor | isadjacent | ▶ |
© 2010-2013 Colin Neil Jones: EPF Lausanne, colin.jones@epfl.ch
© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk
© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch