Test if a polyhedron shares a facet with another polyhedron.
ts = P.isAdjacent(Q)
ts = isAdjacent(P,Q)
[ts, iP, iQ] = isAdjacent(P,Q,fP,fQ)
P |
Polyhedron in H-representation Class: Polyhedron |
Q |
Polyhedron in H-representation Class: Polyhedron |
fP |
Index of a facet to test from polyhedron ![]() Class: double |
fQ |
Index of a facet to test from polyhedron ![]() Class: double |
ts |
Logical statement if the polyhedron ![]() ![]() Class: logical Allowed values:
|
iP |
Index of a facet from polyhedron ![]() ![]() Class: double |
iQ |
Index of a facet from polyhedron ![]() ![]() Class: double |
H1 = [ 0.8905, 0.23614, 10; -0.055625, 0.030184, 0; -0.21887, -0.06688, 0; 0, -1, 10; 1, 0, 10; 0, 1, 5; 0, 1, 20];
H2 = [0.055625, -0.030184, 0; -0.053731, -0.010858, 0; 0, 1, 10];
P = Polyhedron('H',H1);
Q = Polyhedron('H',H2);Plot the polyhedrons.
plot([P,Q]);
P.isAdjacent(Q)
ans = 0If the polyhedrons are touching on the facet, they are neighbors that can be checked by isNeighbor method.
P.isNeighbor(Q)
ans = 1
H1 = [ 0.8905, 0.23614, 10; -0.055625, 0.030184, 0; -0.21887, -0.06688, 0; 0, -1, 10; 1, 0, 10; 0, 1, 5; 0, 1, 20];
H2 = [ 1.84286377 -1 0; 1.05619465 1 7.865634; -4.9485172 -1 0];
P = Polyhedron('H',H1);
Q = Polyhedron('H',H2);Plot the polyhedrons.
plot([P,Q]);
[ts, iP, iQ] = P.isAdjacent(Q)
ts = 1 iP = 2 iQ = 1
◀ | contains | projection | ▶ |
© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch