Cody

Solution 1897151

Submitted on 11 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 = 1; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

m = 25 c = 1 m = 25.0601 c = 2 m = 25.0461 c = 3 m = 25.0461 c = 4 m = 25.0601 c = 5

2   Pass
p = [0,6.58; 6.42,1.92; 3.97,-5.63; -3.97,-5.63; -6.42,1.92]; cp = [0,0]; r = 5; y_correct = 2; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

m = 43.2964 c = 100 m = 44.9028 c = 200 m = 47.4578 c = 300 m = 47.4578 c = 400 m = 44.9028 c = 500

3   Pass
p = [0,4.55; 4.28,1.44; 2.65,-3.59; -2.65,-3.59; -4.28,1.44]; cp = [0,0]; r = 5; y_correct = 0; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

m = 20.7025 m = 20.3920 m = 19.9106 m = 19.9106 m = 20.3920

4   Pass
cp = [20,8]; p = [0,5; 4.76,1.55; 2.94,-4.05; -2.94,-4.05; -4.76,1.55] + repmat(cp,[5,1]); r = 5; y_correct = 1; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

m = 25 c = 1 m = 25.0601 c = 2 m = 25.0461 c = 3 m = 25.0461 c = 4 m = 25.0601 c = 5

5   Pass
cp = [20,8]; p = [0,6.58; 6.42,1.92; 3.97,-5.63; -3.97,-5.63; -6.42,1.92] + repmat(cp,[5,1]); r = 5; y_correct = 2; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

m = 43.2964 c = 100 m = 44.9028 c = 200 m = 47.4578 c = 300 m = 47.4578 c = 400 m = 44.9028 c = 500

6   Pass
cp = [20,8]; p = [0,4.55; 4.28,1.44; 2.65,-3.59; -2.65,-3.59; -4.28,1.44] + repmat(cp,[5,1]); r = 5; y_correct = 0; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

m = 20.7025 m = 20.3920 m = 19.9106 m = 19.9106 m = 20.3920

7   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 = 1; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

m = 25.0920 c = 1 m = 24.9533 c = 2 m = 24.9125 c = 3 m = 24.9616 c = 4 m = 25.0637 c = 5

8   Pass
p = [25.01,12.47; 25.98,4.58; 18.78,1.23; 13.37,7.03; 17.22,13.97]; cp = [20,8]; r = 5; y_correct = 2; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

m = 45.0810 c = 100 m = 47.4568 c = 200 m = 47.3213 c = 300 m = 44.8978 c = 400 m = 43.3693 c = 500

9   Pass
p = [23.27,11.12; 23.92,5.87; 19.12,3.63; 15.52,7.50; 18.08,12.13]; cp = [20,8]; r = 5; y_correct = 0; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

m = 20.4273 m = 19.9033 m = 19.8713 m = 20.3204 m = 20.7433

10   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 = 1; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

m = 76.7570 c = 1 m = 76.4992 c = 2 m = 76.3538 c = 3 m = 76.5216 c = 4 m = 76.7561 c = 5

11   Pass
p = [32.54,38.78; 38.84,26.41; 29.02,16.59; 16.65,22.89; 18.83,36.61]; cp = [26.97,28.45]; r = 8.75; y_correct = 2; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

m = 137.7338 c = 100 m = 145.0585 c = 200 m = 144.8621 c = 300 m = 137.4160 c = 400 m = 132.8452 c = 500

12   Pass
p = [30.49,35.54; 34.69,27.29; 28.14,20.74; 19.89,24.95; 21.34,34.09]; cp = [26.97,28.45]; r = 8.75; y_correct = 0; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

m = 62.6585 m = 60.9440 m = 60.8130 m = 62.3764 m = 63.5065