Cody

# Problem 44368. Inscribed Pentagon?

Solution 2024013

Submitted on 16 Nov 2019 at 9:30
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 = 1; assert(isequal(inscribed_pentagon(p,cp,r),y_correct))

a = 0 5 d = 5 y = 2 a = 4.7600 1.5500 d = 5.0060 y = 2 a = 2.9400 -4.0500 d = 5.0046 y = 2 a = -2.9400 -4.0500 d = 5.0046 y = 2 a = -4.7600 1.5500 d = 5.0060 y = 2

Assertion failed.

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

a = 0 6.5800 d = 6.5800 y = 2 a = 6.4200 1.9200 d = 6.7010 y = 2 a = 3.9700 -5.6300 d = 6.8890 y = 2 a = -3.9700 -5.6300 d = 6.8890 y = 2 a = -6.4200 1.9200 d = 6.7010 y = 2

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

a = 0 4.5500 d = 4.5500 y = 0 a = 4.2800 1.4400 d = 4.5158 y = 0 a = 2.6500 -3.5900 d = 4.4621 y = 0 a = -2.6500 -3.5900 d = 4.4621 y = 0 a = -4.2800 1.4400 d = 4.5158 y = 0

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

a = 20 13 d = 5 y = 2 a = 24.7600 9.5500 d = 5.0060 y = 2 a = 22.9400 3.9500 d = 5.0046 y = 2 a = 17.0600 3.9500 d = 5.0046 y = 2 a = 15.2400 9.5500 d = 5.0060 y = 2

Assertion failed.

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

a = 20.0000 14.5800 d = 6.5800 y = 2 a = 26.4200 9.9200 d = 6.7010 y = 2 a = 23.9700 2.3700 d = 6.8890 y = 2 a = 16.0300 2.3700 d = 6.8890 y = 2 a = 13.5800 9.9200 d = 6.7010 y = 2

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

a = 20.0000 12.5500 d = 4.5500 y = 0 a = 24.2800 9.4400 d = 4.5158 y = 0 a = 22.6500 4.4100 d = 4.4621 y = 0 a = 17.3500 4.4100 d = 4.4621 y = 0 a = 15.7200 9.4400 d = 4.5158 y = 0

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

a = 23.6600 11.4200 d = 5.0092 y = 2 a = 24.3700 5.5800 d = 4.9953 y = 0 a = 19.0500 3.1000 d = 4.9912 y = 0 a = 15.0400 7.4000 d = 4.9962 y = 0 a = 17.8900 12.5400 d = 5.0064 y = 2

Assertion failed.

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

a = 25.0100 12.4700 d = 6.7142 y = 2 a = 25.9800 4.5800 d = 6.8889 y = 2 a = 18.7800 1.2300 d = 6.8790 y = 2 a = 13.3700 7.0300 d = 6.7006 y = 2 a = 17.2200 13.9700 d = 6.5855 y = 2

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

a = 23.2700 11.1200 d = 4.5197 y = 0 a = 23.9200 5.8700 d = 4.4613 y = 0 a = 19.1200 3.6300 d = 4.4577 y = 0 a = 15.5200 7.5000 d = 4.5078 y = 0 a = 18.0800 12.1300 d = 4.5545 y = 0

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

a = 30.9400 36.2600 d = 8.7611 y = 2 a = 35.6100 27.0900 d = 8.7464 y = 0 a = 28.3400 19.8200 d = 8.7381 y = 0 a = 19.1700 24.4900 d = 8.7477 y = 0 a = 20.7800 34.6500 d = 8.7611 y = 2

Assertion failed.

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

a = 32.5400 38.7800 d = 11.7360 y = 2 a = 38.8400 26.4100 d = 12.0440 y = 2 a = 29.0200 16.5900 d = 12.0359 y = 2 a = 16.6500 22.8900 d = 11.7225 y = 2 a = 18.8300 36.6100 d = 11.5258 y = 2

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

a = 30.4900 35.5400 d = 7.9157 y = 0 a = 34.6900 27.2900 d = 7.8067 y = 0 a = 28.1400 20.7400 d = 7.7983 y = 0 a = 19.8900 24.9500 d = 7.8979 y = 0 a = 21.3400 34.0900 d = 7.9691 y = 0