Cody

# Problem 44369. Circle/Pentagon Overlap

Solution 1895916

Submitted on 9 Aug 2019 by Ryouichi Yamaguchi
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))

a = 0 5 b = 25 c = 25.2004 y = 1 a = 4.7600 1.5500 b = 25.0601 c = 25.2004 y = 2 a = 2.9400 -4.0500 b = 25.0461 c = 25.2004 y = 3 a = -2.9400 -4.0500 b = 25.0461 c = 25.2004 y = 4 a = -4.7600 1.5500 b = 25.0601 c = 25.2004 y = 5 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))

a = 0 5 b = 25 c = 16.1604 a = 4.7600 1.5500 b = 25.0601 c = 16.1604 a = 2.9400 -4.0500 b = 25.0461 c = 16.1604 a = -2.9400 -4.0500 b = 25.0461 c = 16.1604 a = -4.7600 1.5500 b = 25.0601 c = 16.1604 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))

a = 0 5 b = 25 c = 225.6004 y = 1 a = 4.7600 1.5500 b = 25.0601 c = 225.6004 y = 2 a = 2.9400 -4.0500 b = 25.0461 c = 225.6004 y = 3 a = -2.9400 -4.0500 b = 25.0461 c = 225.6004 y = 4 a = -4.7600 1.5500 b = 25.0601 c = 225.6004 y = 5 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))

a = -2 5 b = 29 c = 25.2004 a = 2.7600 1.5500 b = 10.0201 c = 25.2004 y = 1 a = 0.9400 -4.0500 b = 17.2861 c = 25.2004 y = 2 a = -4.9400 -4.0500 b = 40.8061 c = 25.2004 a = -6.7600 1.5500 b = 48.1001 c = 25.2004 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))

a = -2.0000 4.2500 b = 22.0625 c = 25.2004 y = 1 a = 2.7600 0.8000 b = 8.2576 c = 25.2004 y = 2 a = 0.9400 -4.8000 b = 23.9236 c = 25.2004 y = 3 a = -4.9400 -4.8000 b = 47.4436 c = 25.2004 a = -6.7600 0.8000 b = 46.3376 c = 25.2004 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))

a = -7.5000 5.0000 b = 81.2500 c = 25.2004 a = -2.7400 1.5500 b = 9.9101 c = 25.2004 y = 1 a = -4.5600 -4.0500 b = 37.1961 c = 25.2004 a = -10.4400 -4.0500 b = 125.3961 c = 25.2004 a = -12.2600 1.5500 b = 152.7101 c = 25.2004 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))

a = 0 10 b = 100 c = 81.3604 a = 4.7600 6.5500 b = 65.5601 c = 81.3604 y = 1 a = 2.9400 0.9500 b = 9.5461 c = 81.3604 y = 2 a = -2.9400 0.9500 b = 9.5461 c = 81.3604 y = 3 a = -4.7600 6.5500 b = 65.5601 c = 81.3604 y = 4 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))

a = 3.6600 3.4200 b = 25.0920 c = 25.2004 y = 1 a = 4.3700 -2.4200 b = 24.9533 c = 25.2004 y = 2 a = -0.9500 -4.9000 b = 24.9125 c = 25.2004 y = 3 a = -4.9600 -0.6000 b = 24.9616 c = 25.2004 y = 4 a = -2.1100 4.5400 b = 25.0637 c = 25.2004 y = 5 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))

a = 4.6600 3.4200 b = 33.4120 c = 25.2004 a = 5.3700 -2.4200 b = 34.6933 c = 25.2004 a = 0.0500 -4.9000 b = 24.0125 c = 25.2004 y = 1 a = -3.9600 -0.6000 b = 16.0416 c = 25.2004 y = 2 a = -1.1100 4.5400 b = 21.8437 c = 25.2004 y = 3 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))

a = 4.1600 1.4200 b = 19.3220 c = 25.2004 y = 1 a = 4.8700 -4.4200 b = 43.2533 c = 25.2004 a = -0.4500 -6.9000 b = 47.8125 c = 25.2004 a = -4.4600 -2.6000 b = 26.6516 c = 25.2004 a = -1.6100 2.5400 b = 9.0437 c = 25.2004 y = 2 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))

a = 4.1600 1.4200 b = 19.3220 c = 43.8244 y = 1 a = 4.8700 -4.4200 b = 43.2533 c = 43.8244 y = 2 a = -0.4500 -6.9000 b = 47.8125 c = 43.8244 a = -4.4600 -2.6000 b = 26.6516 c = 43.8244 y = 3 a = -1.6100 2.5400 b = 9.0437 c = 43.8244 y = 4 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))

a = 4.1600 1.4200 b = 19.3220 c = 49.2804 y = 1 a = 4.8700 -4.4200 b = 43.2533 c = 49.2804 y = 2 a = -0.4500 -6.9000 b = 47.8125 c = 49.2804 y = 3 a = -4.4600 -2.6000 b = 26.6516 c = 49.2804 y = 4 a = -1.6100 2.5400 b = 9.0437 c = 49.2804 y = 5 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))

a = 3.9700 7.8100 b = 76.7570 c = 76.9129 y = 1 a = 8.6400 -1.3600 b = 76.4992 c = 76.9129 y = 2 a = 1.3700 -8.6300 b = 76.3538 c = 76.9129 y = 3 a = -7.8000 -3.9600 b = 76.5216 c = 76.9129 y = 4 a = -6.1900 6.2000 b = 76.7561 c = 76.9129 y = 5 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))

a = 3.9700 7.8100 b = 76.7570 c = 64.3204 a = 8.6400 -1.3600 b = 76.4992 c = 64.3204 a = 1.3700 -8.6300 b = 76.3538 c = 64.3204 a = -7.8000 -3.9600 b = 76.5216 c = 64.3204 a = -6.1900 6.2000 b = 76.7561 c = 64.3204 y = 0