Cody

Solution 1320017

Submitted on 30 Oct 2017 by Marco Tullio
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
p = [0,5; 4.76,1.55; 2.94,-4.05; -2.94,-4.05; -4.76,1.55]; cp = [0,0]; r = 5; y_correct = 5; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 25.0000 25.0601 25.0461 25.0461 25.0601 a = 5×1 logical array 1 1 1 1 1 y = 5

2   Pass
p = [0,5; 4.76,1.55; 2.94,-4.05; -2.94,-4.05; -4.76,1.55]; cp = [0,0]; r = 4; y_correct = 0; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 25.0000 25.0601 25.0461 25.0461 25.0601 a = 5×1 logical array 0 0 0 0 0 y = 0 y = 0

3   Pass
p = [0,5; 4.76,1.55; 2.94,-4.05; -2.94,-4.05; -4.76,1.55]; cp = [0,0]; r = 15; y_correct = 5; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 25.0000 25.0601 25.0461 25.0461 25.0601 a = 5×1 logical array 1 1 1 1 1 y = 5

4   Pass
p = [0,5; 4.76,1.55; 2.94,-4.05; -2.94,-4.05; -4.76,1.55]; cp = [2,0]; r = 5; y_correct = 2; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 29.0000 10.0201 17.2861 40.8061 48.1001 a = 5×1 logical array 0 1 1 0 0 y = 2

5   Pass
p = [0,5; 4.76,1.55; 2.94,-4.05; -2.94,-4.05; -4.76,1.55]; cp = [2,0.75]; r = 5; y_correct = 3; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 22.0625 8.2576 23.9236 47.4436 46.3376 a = 5×1 logical array 1 1 1 0 0 y = 3

6   Pass
p = [0,5; 4.76,1.55; 2.94,-4.05; -2.94,-4.05; -4.76,1.55]; cp = [7.5,0]; r = 5; y_correct = 1; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 81.2500 9.9101 37.1961 125.3961 152.7101 a = 5×1 logical array 0 1 0 0 0 y = 1

7   Pass
p = [0,5; 4.76,1.55; 2.94,-4.05; -2.94,-4.05; -4.76,1.55]; cp = [0,-5]; r = 9; y_correct = 4; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 100.0000 65.5601 9.5461 9.5461 65.5601 a = 5×1 logical array 0 1 1 1 1 y = 4

8   Pass
p = [23.66,11.42; 24.37,5.58; 19.05,3.10; 15.04,7.40; 17.89,12.54]; cp = [20,8]; r = 5; y_correct = 5; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 25.0920 24.9533 24.9125 24.9616 25.0637 a = 5×1 logical array 1 1 1 1 1 y = 5

9   Pass
p = [23.66,11.42; 24.37,5.58; 19.05,3.10; 15.04,7.40; 17.89,12.54]; cp = [19,8]; r = 5; y_correct = 3; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 33.4120 34.6933 24.0125 16.0416 21.8437 a = 5×1 logical array 0 0 1 1 1 y = 3

10   Pass
p = [23.66,11.42; 24.37,5.58; 19.05,3.10; 15.04,7.40; 17.89,12.54]; cp = [19.5,10]; r = 5; y_correct = 2; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 19.3220 43.2533 47.8125 26.6516 9.0437 a = 5×1 logical array 1 0 0 0 1 y = 2

11   Pass
p = [23.66,11.42; 24.37,5.58; 19.05,3.10; 15.04,7.40; 17.89,12.54]; cp = [19.5,10]; r = 6.6; y_correct = 4; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 19.3220 43.2533 47.8125 26.6516 9.0437 a = 5×1 logical array 1 1 0 1 1 y = 4

12   Pass
p = [23.66,11.42; 24.37,5.58; 19.05,3.10; 15.04,7.40; 17.89,12.54]; cp = [19.5,10]; r = 7; y_correct = 5; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 19.3220 43.2533 47.8125 26.6516 9.0437 a = 5×1 logical array 1 1 1 1 1 y = 5

13   Pass
p = [30.94,36.26; 35.61,27.09; 28.34,19.82; 19.17,24.49; 20.78,34.65]; cp = [26.97,28.45]; r = 8.75; y_correct = 5; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 76.7570 76.4992 76.3538 76.5216 76.7561 a = 5×1 logical array 1 1 1 1 1 y = 5

14   Pass
p = [30.94,36.26; 35.61,27.09; 28.34,19.82; 19.17,24.49; 20.78,34.65]; cp = [26.97,28.45]; r = 8; y_correct = 0; assert(isequal(circle_pentagon_overlap(p,cp,r),y_correct))

d2 = 76.7570 76.4992 76.3538 76.5216 76.7561 a = 5×1 logical array 0 0 0 0 0 y = 0