Cody

# Problem 44369. Circle/Pentagon Overlap

Solution 3000493

Submitted on 28 Sep 2020
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
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))

ans = 0 5.0000 4.7600 1.5500 2.9400 -4.0500 -2.9400 -4.0500 -4.7600 1.5500

Assertion failed.

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

ans = 0 5.0000 4.7600 1.5500 2.9400 -4.0500 -2.9400 -4.0500 -4.7600 1.5500

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

ans = 0 5.0000 4.7600 1.5500 2.9400 -4.0500 -2.9400 -4.0500 -4.7600 1.5500

Assertion failed.

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

ans = -2.0000 5.0000 2.7600 1.5500 0.9400 -4.0500 -4.9400 -4.0500 -6.7600 1.5500

Assertion failed.

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

ans = -2.0000 4.2500 2.7600 0.8000 0.9400 -4.8000 -4.9400 -4.8000 -6.7600 0.8000

Assertion failed.

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

ans = -7.5000 5.0000 -2.7400 1.5500 -4.5600 -4.0500 -10.4400 -4.0500 -12.2600 1.5500

Assertion failed.

7   Fail
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))

ans = 0 10.0000 4.7600 6.5500 2.9400 0.9500 -2.9400 0.9500 -4.7600 6.5500

Assertion failed.

8   Fail
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))

ans = 3.6600 3.4200 4.3700 -2.4200 -0.9500 -4.9000 -4.9600 -0.6000 -2.1100 4.5400

Assertion failed.

9   Fail
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))

ans = 4.6600 3.4200 5.3700 -2.4200 0.0500 -4.9000 -3.9600 -0.6000 -1.1100 4.5400

Assertion failed.

10   Fail
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))

ans = 4.1600 1.4200 4.8700 -4.4200 -0.4500 -6.9000 -4.4600 -2.6000 -1.6100 2.5400

Assertion failed.

11   Fail
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))

ans = 4.1600 1.4200 4.8700 -4.4200 -0.4500 -6.9000 -4.4600 -2.6000 -1.6100 2.5400

Assertion failed.

12   Fail
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))

ans = 4.1600 1.4200 4.8700 -4.4200 -0.4500 -6.9000 -4.4600 -2.6000 -1.6100 2.5400

Assertion failed.

13   Fail
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))

ans = 3.9700 7.8100 8.6400 -1.3600 1.3700 -8.6300 -7.8000 -3.9600 -6.1900 6.2000

Assertion failed.

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

ans = 3.9700 7.8100 8.6400 -1.3600 1.3700 -8.6300 -7.8000 -3.9600 -6.1900 6.2000

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!