This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Shortest REAL solution so far. All the shorter ones use som form of cheating!
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
A = 12;
h = 4;
y_correct = [0.8, 0.8, 0.96];
y = theSineOfAnglesOfATriangle(A,h);
assert(abs(y(1)-y_correct(1))<tolerance)
assert(abs(y(2)-y_correct(2))<tolerance)
assert(abs(y(3)-y_correct(3))<tolerance)
|
2 | Pass |
A = 48;
h = 8;
y_correct = [0.8, 0.8, 0.96];
y = theSineOfAnglesOfATriangle(A,h);
assert(abs(y(1)-y_correct(1))<tolerance)
assert(abs(y(2)-y_correct(2))<tolerance)
assert(abs(y(3)-y_correct(3))<tolerance)
|
3 | Pass |
A = 40;
h = 10;
y_correct = [0.9285, 0.9285, 0.6897];
y = theSineOfAnglesOfATriangle(A,h);
assert(abs(y(1)-y_correct(1))<tolerance)
assert(abs(y(2)-y_correct(2))<tolerance)
assert(abs(y(3)-y_correct(3))<tolerance)
|
4 | Pass |
A = 11;
h = 7;
y_correct = [0.9757, 0.9757, 0.4274];
y = theSineOfAnglesOfATriangle(A,h);
assert(abs(y(1)-y_correct(1))<tolerance)
assert(abs(y(2)-y_correct(2))<tolerance)
assert(abs(y(3)-y_correct(3))<tolerance)
|
5 | Pass |
A = 10;
h = 7;
y_correct = [0.9798, 0.9798, 0.3918];
y = theSineOfAnglesOfATriangle(A,h);
assert(abs(y(1)-y_correct(1))<tolerance)
assert(abs(y(2)-y_correct(2))<tolerance)
assert(abs(y(3)-y_correct(3))<tolerance)
|
6 | Pass |
A = 100;
h = 90;
y_correct = [0.9999, 0.9999, 0.0247];
y = theSineOfAnglesOfATriangle(A,h);
assert(abs(y(1)-y_correct(1))<tolerance)
assert(abs(y(2)-y_correct(2))<tolerance)
assert(abs(y(3)-y_correct(3))<tolerance)
|
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!