Cody

# Problem 44059. Convex Hull Capture

Solution 1973881

Submitted on 13 Oct 2019
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   Pass
uv = [0,0;0,2;2,2;2,0]; xy = [1,1;3,1]; in_correct = [1;0]; in = inHull(uv,xy); assert(isequal(in,in_correct))

in = 2×1 logical array 1 0 on = 2×1 logical array 0 0 in = 1 0

2   Fail
uv = [5,5;5,10;10,10;15,15;15,5;10,15;10,10;15,5;10,15;]; xy = [12,20;4,6;10,12;9,7;18,2;]; in_correct = [0;0;1;1;0;]; in = inHull(uv,xy); assert(isequal(in,in_correct))

in = 5×1 logical array 0 0 1 0 0 on = 5×1 logical array 0 0 1 0 0 in = 0 0 2 0 0

Assertion failed.

3   Fail
uv = [-6,-13;-3,-9;-9,-2;-12,7;25,-14;16,-24;3,15;]; xy = [8,6;15,1;4,-11;-3,9;]; in_correct = [1;0;1;1;]; in = inHull(uv,xy); assert(isequal(in,in_correct))

in = 4×1 logical array 0 0 0 0 on = 4×1 logical array 0 0 0 0 in = 0 0 0 0

Assertion failed.

4   Fail
uv = [4,2;1,3;2,4;4,5;5,0;2,2;6,8;7,0;2,9;1,7;]; xy = [4,6;5,3;2,3;4,9;9,0;5,8;5,9;2,7;4,0;6,2;]; in_correct = [1;1;1;0;0;1;0;1;0;1;]; in = inHull(uv,xy); assert(isequal(in,in_correct))

in = 10×1 logical array 0 0 1 0 0 0 0 1 0 1 on = 10×1 logical array 0 0 0 0 0 0 0 0 0 0 in = 0 0 1 0 0 0 0 1 0 1

Assertion failed.

5   Fail
uv = [10,7;8,3;13,9;12,6;5,19;8,18;0,5;19,14;3,5;2,8;]; xy = [5,5;9,8;4,6;9,1;3,3;7,4;6,9;5,1;6,8;6,6;1,3;1,1;9,4;1,4;0,1;]; in_correct = [1;1;1;0;0;1;1;0;1;1;0;0;1;0;0;]; in = inHull(uv,xy); assert(isequal(in,in_correct))

in = 15×1 logical array 0 1 1 0 0 0 1 0 1 0 0 0 0 0 0 on = 15×1 logical array 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 in = 0 1 1 0 0 0 1 0 1 0 0 0 0 0 0

Assertion failed.

6   Fail
uv = [13,12;10,18;8,4;12,10;16,4;13,2;]; xy = [12,15;9,7;9,13;13,8;]; in_correct = [0;1;0;1;]; in = inHull(uv,xy); assert(isequal(in,in_correct))

in = 4×1 logical array 0 1 0 1 on = 4×1 logical array 0 0 0 1 in = 0 1 0 2

Assertion failed.