Cody

Solution 1978470

Submitted on 16 Oct 2019 by Alvin LAU
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
a = 3; b = 4; c = 5; flag_correct = true; assert(isequal(isRightAngled(a,b,c),flag_correct))

x = 9 16 25 x(:,:,1) = 9 2 7 16 9 0 25 18 9 x(:,:,2) = 16 9 0 23 16 7 32 25 16 x(:,:,3) = 25 18 9 32 25 16 41 34 25 ans = logical 1

2   Pass
a = 3; b = 4; c = 6; flag_correct = false; assert(isequal(isRightAngled(a,b,c),flag_correct))

x = 9 16 36 x(:,:,1) = 9 2 18 16 9 11 36 29 9 x(:,:,2) = 16 9 11 23 16 4 43 36 16 x(:,:,3) = 36 29 9 43 36 16 63 56 36 ans = logical 0

3   Pass
a = 3; b = 5; c = 4; flag_correct = true; assert(isequal(isRightAngled(a,b,c),flag_correct))

x = 9 25 16 x(:,:,1) = 9 7 2 25 9 18 16 0 9 x(:,:,2) = 25 9 18 41 25 34 32 16 25 x(:,:,3) = 16 0 9 32 16 25 23 7 16 ans = logical 1

4   Pass
a = 4; b = 3; c = 5; flag_correct = true; assert(isequal(isRightAngled(a,b,c),flag_correct))

x = 16 9 25 x(:,:,1) = 16 23 7 9 16 0 25 32 16 x(:,:,2) = 9 16 0 2 9 7 18 25 9 x(:,:,3) = 25 32 16 18 25 9 34 41 25 ans = logical 1

5   Pass
a = 4; b = 5; c = 3; flag_correct = true; assert(isequal(isRightAngled(a,b,c),flag_correct))

x = 16 25 9 x(:,:,1) = 16 7 23 25 16 32 9 0 16 x(:,:,2) = 25 16 32 34 25 41 18 9 25 x(:,:,3) = 9 0 16 18 9 25 2 7 9 ans = logical 1

6   Pass
a = 5; b = 3; c = 4; flag_correct = true; assert(isequal(isRightAngled(a,b,c),flag_correct))

x = 25 9 16 x(:,:,1) = 25 41 34 9 25 18 16 32 25 x(:,:,2) = 9 25 18 7 9 2 0 16 9 x(:,:,3) = 16 32 25 0 16 9 7 23 16 ans = logical 1

7   Pass
a = 5; b = 4; c = 3; flag_correct = true; assert(isequal(isRightAngled(a,b,c),flag_correct))

x = 25 16 9 x(:,:,1) = 25 34 41 16 25 32 9 18 25 x(:,:,2) = 16 25 32 7 16 23 0 9 16 x(:,:,3) = 9 18 25 0 9 16 7 2 9 ans = logical 1

8   Pass
a = 5; b = 12; c = 13; flag_correct = true; assert(isequal(isRightAngled(a,b,c),flag_correct))

x = 25 144 169 x(:,:,1) = 25 94 119 144 25 0 169 50 25 x(:,:,2) = 144 25 0 263 144 119 288 169 144 x(:,:,3) = 169 50 25 288 169 144 313 194 169 ans = logical 1