


DISTANCE Distance between two sets
[d, x1, x2] = distance(P1,P2,Options)
---------------------------------------------------------------------------
DESCRIPTION
---------------------------------------------------------------------------
Computes the distance between two sets
d = min norm(x1-x2)
x1,x2
s.t. x1 in P1
x2 in P2
USAGE:
[d, x1, x2] = distance(P1,P2)
[d, x1, x2] = distance(P1,P2,Options)
---------------------------------------------------------------------------
INPUT
---------------------------------------------------------------------------
P1 - point, polytope or polyarray
P2 - point, polytope or polyarray
Options.dist_norm - norm for computing the distance, 1, 2, inf
Options.abs_tol - absolute tolerance
Options.lpsolver - LP solver, see mpt_solveLP for details
Options.qpsolver - QP solver, see mpt_solveQP for details
Note: At least one input set must be polytope or polyarray!
If Options is missing or some of the fields are not defined, the default
values from mptOptions will be used.
---------------------------------------------------------------------------
OUTPUT
---------------------------------------------------------------------------
d - distance between two sets
x1, x2 - points in the polytopes for which the distance d is achieved
see also POLYTOPE