separate

Purpose

Separate a point/polyhedron from another polyhedron.

Syntax

h = P.separate(x)
h = separate(P, x)
h = P.separate(S)
h = separate(P, S)

Description

Computes a separating hyperplane ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/separate1.png between ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/separate2.png and ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/separate3.png/../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/separate4.png :

../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/separate6.png

or

../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/separate7.png

Input Arguments

P

Polyhedron in any format

Class: Polyhedron

S

Polyhedron in any format

Class: Polyhedron

x

Column vector of length P.Dim.

Class: Polyhedron

Output Arguments

h

Separating hyperplane ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/separate5.png, or [] if none exists.

Class: double

Example(s)

Example 1

Create a Polyhedron:
P = ExamplePoly.poly3d_sin;
Choose a point:
x = [2;2];
Separate and plot
h = P.separate(x);
	 P.plot; hold on; pplot(x,'ro');
	 Polyhedron('He',h).plot('linewidth', 2);
    

../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/separate_img_1.png

Example 2

Create two polyhedra:
P = ExamplePoly.poly3d_sin('d',3);

[U,s]=svd(randn(3)); 

S = ExamplePoly.poly3d_sin.affineMap(U(:,1:2)) + [2;2;2];
Separate and plot:
h = separate(P,S);
Plot the result
plot([P S]); hold on; Polyhedron('He',h).plot('alpha',0.3);

../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/separate_img_2.png


© 2010-2013 Colin Neil Jones: EPF Lausanne, colin.jones@epfl.ch