Cody

# Problem 1452. Minimum Distance between two N-sided Polygons

Solution 1232331

Submitted on 16 Jul 2017
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
polycell={[0 0 0 5 4 5 4 0] [2.5 5.5 3 9 -2 5.6]}; p2p_min=PolytoPol(polycell); assert(abs(p2p_min-0.5)<.01);

[Warning: Duplicate data points have been detected and removed. The Triangulation indices are defined with respect to the unique set of points in delaunayTriangulation.] [Warning: Duplicate data points have been detected and removed. The Triangulation indices are defined with respect to the unique set of points in delaunayTriangulation.]

Index exceeds matrix dimensions. Error in PolytoPol (line 17) a = cand2(2,:);

2   Fail
polycell={[0 10 0 90 50 50 100 90 100 10] [0 110 100 110 50 70]}; p2p_min=PolytoPol(polycell); assert(abs(p2p_min-15.617376)<.01);

[Warning: Duplicate data points have been detected and removed. The Triangulation indices are defined with respect to the unique set of points in delaunayTriangulation.] [Warning: Duplicate data points have been detected and removed. The Triangulation indices are defined with respect to the unique set of points in delaunayTriangulation.]

Index exceeds matrix dimensions. Error in PolytoPol (line 17) a = cand2(2,:);

3   Fail
polycell={[0 110 100 110 50 70] [20 5 50 7 30 5]}; p2p_min=PolytoPol(polycell); assert(abs(p2p_min-63)<.01);

[Warning: Duplicate data points have been detected and removed. The Triangulation indices are defined with respect to the unique set of points in delaunayTriangulation.] [Warning: Duplicate data points have been detected and removed. The Triangulation indices are defined with respect to the unique set of points in delaunayTriangulation.]

Index exceeds matrix dimensions. Error in PolytoPol (line 17) a = cand2(2,:);

4   Fail
polycell={[-5 -5 -4 -4 -3 -3 -2 -2 5 5 5 0] [6 10 6 -10 20 0]}; p2p_min=PolytoPol(polycell); assert(abs(p2p_min-1)<.01);

[Warning: Duplicate data points have been detected and removed. The Triangulation indices are defined with respect to the unique set of points in delaunayTriangulation.] [Warning: Duplicate data points have been detected and removed. The Triangulation indices are defined with respect to the unique set of points in delaunayTriangulation.]

Index exceeds matrix dimensions. Error in PolytoPol (line 17) a = cand2(2,:);