Cody

Solution 191436

Submitted on 15 Jan 2013 by Alfonso Nieto-Castanon
  • Size: 70
  • This is the leading solution.
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
%% L1 = [0 0; 2 2]; L2 = [0 1; 2 1]; [L3,L4] = cross2kiss(L1,L2); L3c = [0 0; 1 1; 2 1] L4c = [0 1; 1 1; 2 2] assert(isequal(L3,L3c)) assert(isequal(L4,L4c))
varargout = [3x2 double] [3x2 double] L3c = 0 0 1 1 2 1 L4c = 0 1 1 1 2 2
2   Pass
%% L1 = [-2 -1; 2 1]; L2 = [-1 1; 1 -1]; [L3,L4] = cross2kiss(L1,L2); L3c = [-2 -1; 0 0; 1 -1]; L4c = [-1 1; 0 0; 2 1]; assert(isequal(L3,L3c)) assert(isequal(L4,L4c))
varargout = [3x2 double] [3x2 double]
3   Pass
%% L1 = [ 5 5; 8 -4]; L2 = [ 5 -2; 9 0]; [L3,L4] = cross2kiss(L1,L2); L3c = [ 5 -2; 7 -1; 8 -4]; L4c = [ 5 5; 7 -1; 9 0]; assert(isequal(L3,L3c)) assert(isequal(L4,L4c))
varargout = [3x2 double] [3x2 double]