Cody

# Problem 1720. Do the lines intersect?

Solution 409288

Submitted on 24 Feb 2014 by J-G van der Toorn
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; 1,1]; b = [0,1; 1,0]; tf_correct = true; assert(isequal(intersecting(a,b),tf_correct ))

vu = 0.5000 0.5000

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

[Warning: Matrix is singular to working precision.] [> In intersecting at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] vu = NaN NaN

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

[Warning: Matrix is singular to working precision.] [> In intersecting at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] vu = NaN NaN

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

vu = 1.1818 1.2727

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

vu = 0.3333 0.5238

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

vu = 0.6667 0.6667