Cody

# Problem 44059. Convex Hull Capture

Solution 1134077

Submitted on 5 Mar 2017 by yurenchu
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))

az = -0.7500 -0.8976 -0.2500 -0.7500 0.2500 0.7500 0.7500 0.8976 in = 2×1 logical array 1 0

2   Pass
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))

az = -0.6944 -0.2500 -0.8789 -0.8524 0.5722 -0.6390 -0.0289 -0.6974 -0.1024 0.6756 -0.6211 -0.0289 -0.5000 -0.1024 0.6756 -0.6211 0.1872 -0.5000 0.2952 0.7500 -0.5628 0.1872 -0.3026 0.3976 0.7500 -0.5628 0.2183 -0.3026 0.3976 0.7500 -0.4372 0.3128 0.1720 0.4604 0.7500 -0.4372 0.3128 0.5000 0.4604 0.8244 -0.3280 0.4220 0.5000 0.7952 0.9278 in = 5×1 logical array 0 0 1 1 0

3   Pass
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))

az = -0.8600 -0.9604 -0.9372 -0.9304 -0.7021 -0.8386 -0.2627 -0.6589 -0.7014 -0.8128 -0.0452 -0.5431 -0.4170 -0.4873 0.5122 -0.5000 -0.2758 -0.3128 0.7313 -0.3337 0.6614 0.7256 0.8072 -0.2189 0.9841 0.9304 0.9114 0.2500 in = 4×1 logical array 1 0 1 1

4   Pass
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))

az = Columns 1 through 9 -0.7500 -0.8976 -0.5000 -0.8128 0.6142 -0.9220 -0.8524 -0.5780 0 -0.7500 -0.7500 -0.2500 -0.6476 0.7104 -0.7148 -0.6872 -0.5000 0 -0.6476 -0.5000 -0.1720 -0.6211 0.7500 -0.7048 -0.6720 -0.5000 0.4220 -0.5000 -0.3128 -0.1476 -0.5886 0.7712 -0.6476 -0.6289 -0.3789 0.5000 -0.5000 0.4372 0.2500 -0.5000 0.8348 -0.6024 -0.5780 -0.3711 0.5000 -0.4474 0.6476 0.2852 -0.5000 0.8789 -0.5526 -0.5452 -0.3026 0.5696 -0.3524 0.6476 0.5000 -0.4648 0.8858 -0.5000 -0.5000 -0.2500 0.6289 0.2500 0.7500 0.5000 -0.3976 0.9114 -0.4220 -0.4304 0.0780 0.6476 0.6872 0.8976 0.5780 -0.1476 1.0000 0 -0.2500 0.5000 0.7500 0.8976 1.0000 1.0000 1.0000 1.0000 0.8976 1.0000 1.0000 0.7500 Column 10 -0.6476 -0.3524 0.5000 0.6652 0.6872 0.7500 0.8524 0.9372 1.0000 1.0000 in = 10×1 logical array 1 1 1 0 0 1 0 1 0 1

5   Pass
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))

az = Columns 1 through 9 -0.1872 -0.8976 -0.9220 0.2913 0 -0.2500 -0.9220 0.1872 -0.8524 0.0452 -0.8524 -0.7500 0.3280 0.1024 0.1211 -0.8128 0.1974 -0.7500 0.1211 -0.5628 -0.2048 0.3524 0.1652 0.2211 -0.7048 0.2382 -0.3789 0.1476 -0.2500 0 0.4474 0.1720 0.2211 -0.3976 0.2500 -0.1024 0.1819 -0.1872 0.0526 0.5187 0.1917 0.2500 -0.1476 0.2789 -0.0780 0.4278 0.0780 0.1024 0.5696 0.3976 0.4773 -0.1476 0.4444 0.0452 0.5000 0.1720 0.1560 0.6476 0.4604 0.5422 0 0.5000 0.1376 0.7500 0.5317 0.3976 0.7500 0.5000 0.7852 0.1169 0.6289 0.4372 1.0000 0.6110 0.4756 0.8128 0.5628 0.9220 0.4304 0.6476 0.5289 1.0000 1.0000 0.7500 0.8669 0.8128 0.9548 0.5317 0.7852 1.0000 Columns 10 through 15 -0.9474 0 0.0886 -0.7500 -0.0452 0.0780 -0.8976 0.0848 0.1358 0.1872 0.0572 0.1257 -0.3128 0.1331 0.1872 0.2500 0.1024 0.1720 0 0.1476 0.1872 0.2852 0.1257 0.1756 0.0780 0.1746 0.1991 0.3976 0.1476 0.1910 0.1289 0.2500 0.3524 0.5227 0.1614 0.2952 0.1756 0.3610 0.3757 0.5830 0.3524 0.3600 0.4474 0.4220 0.4304 0.8348 0.4170 0.4114 0.5244 0.4372 0.4548 0.9474 0.4220 0.4138 0.8524 0.6476 0.5780 0.9648 0.7500 0.5000 in = 15×1 logical array 1 1 1 0 0 1 1 0 1 1 0 0 1 0 0

6   Pass
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))

az = -0.6110 -0.6024 -0.5352 -0.7852 -0.5000 -0.2852 -0.3890 -0.5000 -0.4756 -0.1289 -0.2896 -0.2952 -0.3976 0.2500 -0.2500 0.5000 -0.3890 0.2852 -0.0780 0.5928 0.6872 0.4711 0.4372 0.6476 in = 4×1 logical array 0 1 0 1