Cody

Solution 1596537

Submitted on 31 Jul 2018 by Anna Hughes
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 = [0 0; 120 120; 120 0]; y_correct = 7200; assert(isequal(area_of_polygon(A),y_correct))

meanarea = 7200 1 1 meanarea = 7200 0 1

2   Pass
A = [1 2; 12 3; 6 7]; y_correct = 25; assert(isequal(area_of_polygon(A),y_correct))

meanarea = 27.5000 1.0000 1.0000 meanarea = 27.5000 -30.0000 1.0000

3   Pass
A = [0 0; 0 100; 100 100; 100 0]; y_correct = 10000; assert(isequal(area_of_polygon(A),y_correct))

meanarea = 0 1 1 1 meanarea = 0 10000 1 1 meanarea = 0 10000 0 1

4   Pass
A = [0 0; 0 200; 200 200; 200 0]; y_correct = 40000; assert(isequal(area_of_polygon(A),y_correct))

meanarea = 0 1 1 1 meanarea = 0 40000 1 1 meanarea = 0 40000 0 1

5   Pass
A = [0 0; 0 50; 100 100; 100 0]; y_correct = 7500; assert(isequal(area_of_polygon(A),y_correct))

meanarea = 0 1 1 1 meanarea = 0 7500 1 1 meanarea = 0 7500 0 1

6   Pass
A = [0 0; 200 100; 500 500; 400 1000; 100 300; -100 100; -300 -200]; y_correct = 230000; assert(isequal(area_of_polygon(A),y_correct))

meanarea = 10000 1 1 1 1 1 1 meanarea = 10000 90000 1 1 1 1 1 meanarea = 10000 90000 -75000 1 1 1 1 meanarea = 10000 90000 -75000 -195000 1 1 1 meanarea = 10000 90000 -75000 -195000 -40000 1 1 meanarea = 10000 90000 -75000 -195000 -40000 10000 1