Test if a point is contained inside polyhedron in H-representation.
[isin, inwhich, closest] = isInside(Pn, x0, Options)
[isin, inwhich, closest] = Pn.isInside(x0, Options)
P |
Polyhedron in H-representation. Class: Polyhedron |
x0 |
A point in the same dimension as polyhedron and given as real column vector. Class: double |
Options |
A structure with the option settings for point location problem. Class: struct |
Options.abs_tol |
Absolute tolerance for checking the satisfaction of inequalities and equalities. Class: double Default: mptopt.abs_tol |
Options.fastbreak |
If Pn is the polyhedron array, then do a quick stop in the consecutive search when x0
is contained in any of the polyhedrons.
Class: logical Allowed values:
Default: false |
isin |
True if ![]() Class: logical Allowed values:
|
inwhich |
If Pn is an array of polyhedra in the same dimension, than isin indicates which polyhedra
from this array contain the point x0. Class: double |
closest |
If Pn is an array of polyhedra in the same dimension and none of polyhedra contains x0,
then the field closest indicates which polyhedra has the closest distance for x0 to lie
in it's interior. Class: double |
P(1) = ExamplePoly.randHrep;
P(2) = ExamplePoly.randHrep+[1;1];Check if the point x0=[1.1;0.9] is contained in any of them.
x0 = [1.1; 0.9];
[isin, inwhich] = P.isInside(x0)
isin = 1 inwhich = 2Plot the point and polyhedra
plot(P); hold on; text(x0(1),x0(2),'\bf x')
◀ | uplus | plot | ▶ |
© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch
© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk