Cody

# Problem 1720. Do the lines intersect?

Solution 1242262

Submitted on 30 Jul 2017
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   Fail
a = [0,0; 1,1]; b = [0,1; 1,0]; tf_correct = true; assert(isequal(intersecting(a,b),tf_correct ))

Error using cross (line 25) A and B must be of length 3 in the dimension in which the cross product is taken. Error in intersecting (line 16) C1=cross(B1B2,B1A1); Error in Test1 (line 4) assert(isequal(intersecting(a,b),tf_correct ))

2   Fail
a = [0,0; 1,0]; b = [0,1; 1,1]; tf_correct = false; assert(isequal(intersecting(a,b),tf_correct ))

Error using cross (line 25) A and B must be of length 3 in the dimension in which the cross product is taken. Error in intersecting (line 16) C1=cross(B1B2,B1A1); Error in Test2 (line 4) assert(isequal(intersecting(a,b),tf_correct ))

3   Fail
a = [0,0; 1,0]; b = [2,0; 3,0]; tf_correct = false; assert(isequal(intersecting(a,b),tf_correct ))

Error using cross (line 25) A and B must be of length 3 in the dimension in which the cross product is taken. Error in intersecting (line 16) C1=cross(B1B2,B1A1); Error in Test3 (line 4) assert(isequal(intersecting(a,b),tf_correct ))

4   Fail
a = [4 3;6 8]; b = [3 7;6 9]; tf_correct = false; assert(isequal(intersecting(a,b),tf_correct ))

Error using cross (line 25) A and B must be of length 3 in the dimension in which the cross product is taken. Error in intersecting (line 16) C1=cross(B1B2,B1A1); Error in Test4 (line 4) assert(isequal(intersecting(a,b),tf_correct ))

5   Fail
a = [6 2;6 9]; b = [7 6;4 5]; tf_correct = true; assert(isequal(intersecting(a,b),tf_correct ))

Error using cross (line 25) A and B must be of length 3 in the dimension in which the cross product is taken. Error in intersecting (line 16) C1=cross(B1B2,B1A1); Error in Test5 (line 4) assert(isequal(intersecting(a,b),tf_correct ))

6   Fail
a = [3 -3;-2 -2]; b = [-1 1;0 -4]; tf_correct = true; assert(isequal(intersecting(a,b),tf_correct ))

Error using cross (line 25) A and B must be of length 3 in the dimension in which the cross product is taken. Error in intersecting (line 16) C1=cross(B1B2,B1A1); Error in Test6 (line 4) assert(isequal(intersecting(a,b),tf_correct ))