Cody

# Problem 44817. Wrecked Angles?

Solution 1702475

Submitted on 4 Jan 2019 by Steven Beumer
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);

Aopp = 4 Bopp = 3 ans = 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);

Aopp = 12 Bopp = 5 ans = 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);

Aopp = 24 Bopp = 7 ans = 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);

Aopp = 100 Bopp = 1 ans = 7.8548e+03 Aopp = 100 Bopp = 2 ans = 7.8571e+03 Aopp = 100 Bopp = 3 ans = 7.8611e+03 Aopp = 100 Bopp = 4 ans = 7.8665e+03 Aopp = 100 Bopp = 5 ans = 7.8736e+03 Aopp = 100 Bopp = 6 ans = 7.8823e+03 Aopp = 100 Bopp = 7 ans = 7.8925e+03 Aopp = 100 Bopp = 8 ans = 7.9042e+03 Aopp = 100 Bopp = 9 ans = 7.9176e+03 Aopp = 100 Bopp = 10 ans = 7.9325e+03 Aopp = 100 Bopp = 11 ans = 7.9490e+03 Aopp = 100 Bopp = 12 ans = 7.9671e+03 Aopp = 100 Bopp = 13 ans = 7.9867e+03 Aopp = 100 Bopp = 14 ans = 8.0079e+03 Aopp = 100 Bopp = 15 ans = 8.0307e+03 Aopp = 100 Bopp = 16 ans = 8.0550e+03 Aopp = 100 Bopp = 17 ans = 8.0810e+03 Aopp = 100 Bopp = 18 ans = 8.1085e+03 Aopp = 100 Bopp = 19 ans = 8.1375e+03 Aopp = 100 Bopp = 20 ans = 8.1681e+03 Aopp = 100 Bopp = 21 ans = 8.2003e+03 Aopp = 100 Bopp = 22 ans = 8.2341e+03 Aopp = 100 Bopp = 23 ans = 8.2695e+03 Aopp = 100 Bopp = 24 ans = 8.3064e+03 Aopp = 100 Bopp = 25 ans = 8.3449e+03 Aopp = 100 Bopp = 26 ans = 8.3849e+03 Aopp = 100 Bopp = 27 ans = 8.4265e+03 Aopp = 100 Bopp = 28 ans = 8.4697e+03 Aopp = 100 Bopp = 29 ans = 8.5145e+03 Aopp = 100 Bopp = 30 ans = 8.5608e+03 Aopp = 100 Bopp = 31 ans = 8.6087e+03 Aopp = 100 Bopp = 32 ans = 8.6582e+03 Aopp = 100 Bopp = 33 ans = 8.7093e+03 Aopp = 100 Bopp = 34 ans = 8.7619e+03 Aopp = 100 Bopp = 35 ans = 8.8161e+03 Aopp = 100 Bopp = 36 ans = 8.8719e+03 Aopp = 100 Bopp = 37 ans = 8.9292e+03 Aopp = 100 Bopp = 38 ans = 8.9881e+03 Aopp = 100 Bopp = 39 ans = 9.0486e+03 Aopp = 100 Bopp = 40 ans = 9.1106e+03 Aopp = 100 Bopp = 41 ans = 9.1742e+03 Aopp = 100 Bopp = 42 ans = 9.2394e+03 Aopp = 100 Bopp = 43 ans = 9.3062e+03 Aopp = 100 Bopp = 44 ans = 9.3745e+03 Aopp = 100 Bopp = 45 ans = 9.4444e+03 Aopp = 100 Bopp = 46 ans = 9.5159e+03 Aopp = 100 Bopp = 47 ans = 9.5889e+03 Aopp = 100 Bopp = 48 ans = 9.6635e+03 Aopp = 100 Bopp = 49 ans = 9.7397e+03 Aopp = 100 Bopp = 50 ans = 9.8175e+03 Aopp = 100 Bopp = 51 ans = 9.8968e+03 Aopp = 100 Bopp = 52 ans = 9.9777e+03 Aopp = 100 Bopp = 53 ans = 1.0060e+04 Aopp = 100 Bopp = 54 ans = 1.0144e+04 Aopp = 100 Bopp = 55 ans = 1.0230e+04 Aopp = 100 Bopp = 56 ans = 1.0317e+04 Aopp = 100 Bopp = 57 ans = 1.0406e+04 Aopp = 100 Bopp = 58 ans = 1.0496e+04 Aopp = 100 Bopp = 59 ans = 1.0588e+04 Aopp = 100 Bopp = 60 ans = 1.0681e+04 Aopp = 100 Bopp = 61 ans = 1.0776e+04 Aopp = 100 Bopp = 62 ans = 1.0873e+04 Aopp = 100 Bopp = 63 ans = 1.0971e+04 Aopp = 100 Bopp = 64 ans = 1.1071e+04 Aopp = 100 Bopp = 65 ans = 1.1172e+04 Aopp = 100 Bopp = 66 ans = 1.1275e+04 Aopp = 100 Bopp = 67 ans = 1.1380e+04 Aopp = 100 Bopp = 68 ans = 1.1486e+04 Aopp = 100 Bopp = 69 ans = 1.1593e+04 Aopp = 100 Bopp = 70 ans = 1.1702e+04 Aopp = 100 Bopp = 71 ans = 1.1813e+04 Aopp = 100 Bopp = 72 ans = 1.1925e+04 Aopp = 100 Bopp = 73 ans = 1.2039e+04 Aopp = 100 Bopp = 74 ans = 1.2155e+04 Aopp = 100 Bopp = 75 ans = 1.2272e+04 Aopp = 100 Bopp = 76 ans = 1.2390e+04 Aopp = 100 Bopp = 77 ans = 1.2511e+04 Aopp = 100 Bopp = 78 ans = 1.2632e+04 Aopp = 100 Bopp = 79 ans = 1.2756e+04 Aopp = 100 Bopp = 80 ans = 1.2881e+04 Aopp = 100 Bopp = 81 ans = 1.3007e+04 Aopp = 100 Bopp = 82 ans = 1.3135e+04 Aopp = 100 Bopp = 83 ans = 1.3265e+04 Aopp = 100 Bopp = 84 ans = 1.3396e+04 Aopp = 100 Bopp = 85 ans = 1.3528e+04 Aopp = 100 Bopp = 86 ans = 1.3663e+04 Aopp = 100 Bopp = 87 ans = 1.3799e+04 Aopp = 100 Bopp = 88 ans = 1.3936e+04 Aopp = 100 Bopp = 89 ans = 1.4075e+04 Aopp = 100 Bopp = 90 ans = 1.4216e+04 Aopp = 100 Bopp = 91 ans = 1.4358e+04 Aopp = 100 Bopp = 92 ans = 1.4502e+04 Aopp = 100 Bopp = 93 ans = 1.4647e+04 Aopp = 100 Bopp = 94 ans = 1.4794e+04 Aopp = 100 Bopp = 95 ans = 1.4942e+04 Aopp = 100 Bopp = 96 ans = 1.5092e+04 Aopp = 100 Bopp = 97 ans = 1.5244e+04 Aopp = 100 Bopp = 98 ans = 1.5397e+04 Aopp = 100 Bopp = 99 ans = 1.5552e+04 Aopp = 100 Bopp = 100 ans = 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);

Aopp = 8 Bopp = 8 ans = 100.5310 Aopp = 24 Bopp = 12 ans = 565.4867 Aopp = 565.4867 Bopp = 100.5310 ans = 2.5909e+05

### Community Treasure Hunt

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

Start Hunting!