Cody

Solution 1735886

Submitted on 25 Feb 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
x1 = 1;y1=1;x2=0;y2=0;x3=2;y3=0; y_correct = 1; assert(isequal(triarea(x1,y1,x2,y2,x3,y3),y_correct))

x = 1 0 2 y = 1 0 0 d = 1 0 2 1 0 0 1 1 1 A = 1

2   Pass
x1 = 2;y1=1;x2=5;y2=1;x3=4;y3=3; y_correct = 3; assert(isequal(triarea(x1,y1,x2,y2,x3,y3),y_correct))

x = 2 5 4 y = 1 1 3 d = 2 5 4 1 1 3 1 1 1 A = 3

3   Pass
x1 = 4;y1=0;x2=7;y2=2;x3=2;y3=3; y_correct = 6.5; assert(isequal(triarea(x1,y1,x2,y2,x3,y3),y_correct))

x = 4 7 2 y = 0 2 3 d = 4 7 2 0 2 3 1 1 1 A = 6.5000

Suggested Problems

More from this Author1