Cody

Solution 1450172

Submitted on 26 Feb 2018 by Michal Belorit
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_pentagon2(p,cp,r),y_correct))

k = 0 0.0060 0.0046 0.0046 0.0060

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_pentagon2(p,cp,r),y_correct))

k = 1.5800 1.7010 1.8890 1.8890 1.7010

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_pentagon2(p,cp,r),y_correct))

k = -0.4500 -0.4842 -0.5379 -0.5379 -0.4842

4   Pass
p = [0,5; 4.76,1.55; 2.94,-4.05; -2.94,-4.05; -4.76,1.55]; cp = [0,0.5]; r = 8.75; y_correct = -1; assert(isequal(inscribed_pentagon2(p,cp,r),y_correct))

k = -4.2500 -3.8756 -3.3328 -3.3328 -3.8756

5   Pass
p = [0,5; 4.76,1.55; 2.94,-4.05; -2.94,-4.05; -4.76,1.55]; cp = [1.98,-0.47]; r = 8.75; y_correct = -1; assert(isequal(inscribed_pentagon2(p,cp,r),y_correct))

k = -2.9327 -5.3136 -5.0435 -2.6654 -1.7138

6   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_pentagon2(p,cp,r),y_correct))

k = 0 0.0060 0.0046 0.0046 0.0060

7   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_pentagon2(p,cp,r),y_correct))

k = 1.5800 1.7010 1.8890 1.8890 1.7010

8   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_pentagon2(p,cp,r),y_correct))

k = -0.4500 -0.4842 -0.5379 -0.5379 -0.4842

9   Pass
cp_temp = [20,8]; p = [0,5; 4.76,1.55; 2.94,-4.05; -2.94,-4.05; -4.76,1.55] + repmat(cp_temp,[5,1]); cp = [19.5,9.08]; r = 2.5; y_correct = -1; assert(isequal(inscribed_pentagon2(p,cp,r),y_correct))

k = 1.4518 2.7810 3.6766 3.1807 1.7858

10   Pass
cp_temp = [20,8]; p = [0,5; 4.76,1.55; 2.94,-4.05; -2.94,-4.05; -4.76,1.55] + repmat(cp_temp,[5,1]); cp = [19.86,7.19]; r = 7.5; y_correct = -1; assert(isequal(inscribed_pentagon2(p,cp,r),y_correct))

k = -1.6883 -2.0613 -3.0297 -3.2178 -2.3121

11   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_pentagon2(p,cp,r),y_correct))

k = 0.0092 -0.0047 -0.0088 -0.0038 0.0064

12   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_pentagon2(p,cp,r),y_correct))

k = 1.7142 1.8889 1.8790 1.7006 1.5855

13   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_pentagon2(p,cp,r),y_correct))

k = -0.4803 -0.5387 -0.5423 -0.4922 -0.4455

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

k = 0.0111 -0.0036 -0.0119 -0.0023 0.0111

15   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_pentagon2(p,cp,r),y_correct))

k = 2.9860 3.2940 3.2859 2.9725 2.7758

16   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_pentagon2(p,cp,r),y_correct))

k = -0.8343 -0.9433 -0.9517 -0.8521 -0.7809

17   Pass
p = [30.94,36.26; 35.61,27.09; 28.34,19.82; 19.17,24.49; 20.78,34.65]; cp = [26.41,29.04]; r = 6.13; y_correct = -1; assert(isequal(inscribed_pentagon2(p,cp,r),y_correct))

k = 2.3935 3.2744 3.2898 2.4210 1.8179

18   Pass
p = [30.94,36.26; 35.61,27.09; 28.34,19.82; 19.17,24.49; 20.78,34.65]; cp = [27.07,27.66]; r = 9.63; y_correct = -1; assert(isequal(inscribed_pentagon2(p,cp,r),y_correct))

k = -0.1994 -1.0710 -1.6878 -1.1177 -0.2266