Cody

Solution 399295

Submitted on 7 Feb 2014 by Alfonso Nieto-Castanon
  • Size: 48
  • 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
%% p1=[0.218246;0.224576];%meters p2=[0.769657;0.602542];%meters direction=34.428783;%degrees pointsx=[ 0.350085000000000 0.375000000000000 0.770085000000000 0.753475000000000 0.609915000000000 0.290763000000000 0.301441000000000 0.301441000000000]; pointsy=[ 0.285805000000000 0.400212000000000 0.602331000000000 0.585551000000000 0.497839000000000 0.259873000000000 0.275127000000000 0.275127000000000]; orientations=0*pointsx+direction; orientations(end)=direction+0.6; correctanswers= [ 0 0 1 1 1 0 1 0]; for j=1:length(pointsx) y(j)=isontrack(p1,p2,[pointsx(j); pointsy(j); orientations(j)]); assert(y(j)==correctanswers(j)) end