Cody

# Problem 44817. Wrecked Angles?

Solution 1742253

Submitted on 4 Mar 2019 by Martin C.
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=14; A=12; y=wrecked_angles(P,A); y_correct = 20.63495408493621; junk=abs(y-y_correct); assert(junk-1<1e-10);

r = 4 3 b = 4 a = 3 r = 2.5000 y = 19.6350

2   Pass
P=34; A=60; y=wrecked_angles(P,A); y_correct = 131.7322896141688; junk=abs(y-y_correct); assert(junk-1<1e-10);

r = 12 5 b = 12 a = 5 r = 6.5000 y = 132.7323

3   Pass
P=62; A=168; y=wrecked_angles(P,A); y_correct = 590.8738521234052; junk=abs(y-y_correct); assert(junk-100<1e-10);

r = 24 7 b = 24 a = 7 r = 12.5000 y = 490.8739

4   Pass
s1=100; totalsum=zeros(1,s1); for s2=1:s1 P=2*(s1+s2); A=s1*s2; totalsum(s2)=wrecked_angles(P,A); end s=sum(totalsum); s_correct=1051137.631982975; s_junk=abs(s-s_correct); assert(s_junk<1e-8); d=max(totalsum)-min(totalsum); d_correct=7853.196235811095; d_junk=abs(d-d_correct); assert(d_junk<1e-8);

r = 100 1 b = 100 a = 1 r = 50.0025 y = 7.8548e+03 r = 100 2 b = 100 a = 2 r = 50.0100 y = 7.8571e+03 r = 100 3 b = 100 a = 3 r = 50.0225 y = 7.8611e+03 r = 100 4 b = 100 a = 4 r = 50.0400 y = 7.8665e+03 r = 100 5 b = 100 a = 5 r = 50.0625 y = 7.8736e+03 r = 100 6 b = 100 a = 6 r = 50.0899 y = 7.8823e+03 r = 100 7 b = 100 a = 7 r = 50.1224 y = 7.8925e+03 r = 100 8 b = 100 a = 8 r = 50.1597 y = 7.9042e+03 r = 100 9 b = 100 a = 9 r = 50.2021 y = 7.9176e+03 r = 100 10 b = 100 a = 10 r = 50.2494 y = 7.9325e+03 r = 100 11 b = 100 a = 11 r = 50.3016 y = 7.9490e+03 r = 100 12 b = 100 a = 12 r = 50.3587 y = 7.9671e+03 r = 100 13 b = 100 a = 13 r = 50.4207 y = 7.9867e+03 r = 100 14 b = 100 a = 14 r = 50.4876 y = 8.0079e+03 r = 100 15 b = 100 a = 15 r = 50.5594 y = 8.0307e+03 r = 100 16 b = 100 a = 16 r = 50.6360 y = 8.0550e+03 r = 100 17 b = 100 a = 17 r = 50.7174 y = 8.0810e+03 r = 100 18 b = 100 a = 18 r = 50.8035 y = 8.1085e+03 r = 100 19 b = 100 a = 19 r = 50.8945 y = 8.1375e+03 r = 100 20 b = 100 a = 20 r = 50.9902 y = 8.1681e+03 r = 100 21 b = 100 a = 21 r = 51.0906 y = 8.2003e+03 r = 100 22 b = 100 a = 22 r = 51.1957 y = 8.2341e+03 r = 100 23 b = 100 a = 23 r = 51.3055 y = 8.2695e+03 r = 100 24 b = 100 a = 24 r = 51.4198 y = 8.3064e+03 r = 100 25 b = 100 a = 25 r = 51.5388 y = 8.3449e+03 r = 100 26 b = 100 a = 26 r = 51.6624 y = 8.3849e+03 r = 100 27 b = 100 a = 27 r = 51.7904 y = 8.4265e+03 r = 100 28 b = 100 a = 28 r = 51.9230 y = 8.4697e+03 r = 100 29 b = 100 a = 29 r = 52.0601 y = 8.5145e+03 r = 100 30 b = 100 a = 30 r = 52.2015 y = 8.5608e+03 r = 100 31 b = 100 a = 31 r = 52.3474 y = 8.6087e+03 r = 100 32 b = 100 a = 32 r = 52.4976 y = 8.6582e+03 r = 100 33 b = 100 a = 33 r = 52.6522 y = 8.7093e+03 r = 100 34 b = 100 a = 34 r = 52.8110 y = 8.7619e+03 r = 100 35 b = 100 a = 35 r = 52.9741 y = 8.8161e+03 r = 100 36 b = 100 a = 36 r = 53.1413 y = 8.8719e+03 r = 100 37 b = 100 a = 37 r = 53.3128 y = 8.9292e+03 r = 100 38 b = 100 a = 38 r = 53.4883 y = 8.9881e+03 r = 100.0000 39.0000 b = 100.0000 a = 39.0000 r = 53.6680 y = 9.0486e+03 r = 100 40 b = 100 a = 40 r = 53.8516 y = 9.1106e+03 r = 100 41 b = 100 a = 41 r = 54.0393 y = 9.1742e+03 r = 100 42 b = 100 a = 42 r = 54.2310 y = 9.2394e+03 r = 100 43 b = 100 a = 43 r = 54.4266 y = 9.3062e+03 r = 100 44 b = 100 a = 44 r = 54.6260 y = 9.3745e+03 r = 100 45 b = 100 a = 45 r = 54.8293 y = 9.4444e+03 r = 100 46 b = 100 a = 46 r = 55.0364 y = 9.5159e+03 r = 100 47 b = 100 a = 47 r = 55.2472 y = 9.5889e+03 r = 100 48 b = 100 a = 48 r = 55.4617 y = 9.6635e+03 r = 100 49 b = 100 a = 49 r = 55.6799 y = 9.7397e+03 r = 100 50 b = 100 a = 50 r = 55.9017 y = 9.8175e+03 r = 100 51 b = 100 a = 51 r = 56.1271 y = 9.8968e+03 r = 100 52 b = 100 a = 52 r = 56.3560 y = 9.9777e+03 r = 100 53 b = 100 a = 53 r = 56.5884 y = 1.0060e+04 r = 100.0000 54.0000 b = 100.0000 a = 54.0000 r = 56.8243 y = 1.0144e+04 r = 100 55 b = 100 a = 55 r = 57.0636 y = 1.0230e+04 r = 100.0000 56.0000 b = 100.0000 a = 56.0000 r = 57.3062 y = 1.0317e+04 r = 100.0000 57.0000 b = 100.0000 a = 57.0000 r = 57.5522 y = 1.0406e+04 r = 100.0000 58.0000 b = 100.0000 a = 58.0000 r = 57.8014 y = 1.0496e+04 r = 100.0000 59.0000 b = 100.0000 a = 59.0000 r = 58.0539 y = 1.0588e+04 r = 100 60 b = 100 a = 60 r = 58.3095 y = 1.0681e+04 r = 100.0000 61.0000 b = 100.0000 a = 61.0000 r = 58.5683 y = 1.0776e+04 r = 100.0000 62.0000 b = 100.0000 a = 62.0000 r = 58.8303 y = 1.0873e+04 r = 100.0000 63.0000 b = 100.0000 a = 63.0000 r = 59.0953 y = 1.0971e+04 r = 100.0000 64.0000 b = 100.0000 a = 64.0000 r = 59.3633 y = 1.1071e+04 r = 100.0000 65.0000 b = 100.0000 a = 65.0000 r = 59.6343 y = 1.1172e+04 r = 100.0000 66.0000 b = 100.0000 a = 66.0000 r = 59.9083 y = 1.1275e+04 r = 100.0000 67.0000 b = 100.0000 a = 67.0000 r = 60.1851 y = 1.1380e+04 r = 100.0000 68.0000 b = 100.0000 a = 68.0000 r = 60.4649 y = 1.1486e+04 r = 100.0000 69.0000 b = 100.0000 a = 69.0000 r = 60.7474 y = 1.1593e+04 r = 100.0000 70.0000 b = 100.0000 a = 70.0000 r = 61.0328 y = 1.1702e+04 r = 100.0000 71.0000 b = 100.0000 a = 71.0000 r = 61.3209 y = 1.1813e+04 r = 100.0000 72.0000 b = 100.0000 a = 72.0000 r = 61.6117 y = 1.1925e+04 r = 100.0000 73.0000 b = 100.0000 a = 73.0000 r = 61.9052 y = 1.2039e+04 r = 100.0000 74.0000 b = 100.0000 a = 74.0000 r = 62.2013 y = 1.2155e+04 r = 100.0000 75.0000 b = 100.0000 a = 75.0000 r = 62.5000 y = 1.2272e+04 r = 100.0000 76.0000 b = 100.0000 a = 76.0000 r = 62.8013 y = 1.2390e+04 r = 100.0000 77.0000 b = 100.0000 a = 77.0000 r = 63.1051 y = 1.2511e+04 r = 100.0000 78.0000 b = 100.0000 a = 78.0000 r = 63.4114 y = 1.2632e+04 r = 100.0000 79.0000 b = 100.0000 a = 79.0000 r = 63.7201 y = 1.2756e+04 r = 100.0000 80.0000 b = 100.0000 a = 80.0000 r = 64.0312 y = 1.2881e+04 r = 100.0000 81.0000 b = 100.0000 a = 81.0000 r = 64.3448 y = 1.3007e+04 r = 100 82 b = 100 a = 82 r = 64.6607 y = 1.3135e+04 r = 100 83 b = 100 a = 83 r = 64.9788 y = 1.3265e+04 r = 100 84 b = 100 a = 84 r = 65.2993 y = 1.3396e+04 r = 100 85 b = 100 a = 85 r = 65.6220 y = 1.3528e+04 r = 100 86 b = 100 a = 86 r = 65.9469 y = 1.3663e+04 r = 100 87 b = 100 a = 87 r = 66.2741 y = 1.3799e+04 r = 100 88 b = 100 a = 88 r = 66.6033 y = 1.3936e+04 r = 100 89 b = 100 a = 89 r = 66.9347 y = 1.4075e+04 r = 100 90 b = 100 a = 90 r = 67.2681 y = 1.4216e+04 r = 100 91 b = 100 a = 91 r = 67.6036 y = 1.4358e+04 r = 100 92 b = 100 a = 92 r = 67.9412 y = 1.4502e+04 r = 100 93 b = 100 a = 93 r = 68.2807 y = 1.4647e+04 r = 100 94 b = 100 a = 94 r = 68.6222 y = 1.4794e+04 r = 100 95 b = 100 a = 95 r = 68.9656 y = 1.4942e+04 r = 100 96 b = 100 a = 96 r = 69.3109 y = 1.5092e+04 r = 100 97 b = 100 a = 97 r = 69.6581 y = 1.5244e+04 r = 100 98 b = 100 a = 98 r = 70.0071 y = 1.5397e+04 r = 100 99 b = 100 a = 99 r = 70.3580 y = 1.5552e+04 r = 100.0000 100.0000 b = 100.0000 a = 100.0000 r = 70.7107 y = 1.5708e+04

5   Pass
s1=wrecked_angles(32,64); s2=wrecked_angles(72,288); P=2*(s1+s2); A=s1*s2; y=wrecked_angles(P,A); y_correct=259088.4479405854; junk=abs(y-y_correct); assert(junk<1e-10);

r = 8 8 b = 8 a = 8 r = 5.6569 y = 100.5310 r = 24 12 b = 24 a = 12 r = 13.4164 y = 565.4867 r = 565.4867 100.5310 b = 565.4867 a = 100.5310 r = 287.1766 y = 2.5909e+05