-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrontCorruptCheck.m
More file actions
14 lines (14 loc) · 856 Bytes
/
frontCorruptCheck.m
File metadata and controls
14 lines (14 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function type = frontCorruptCheck(corruptWindow,t_in,t_out,Y1,X1,Y2,X2,time2turn)
% kiem tra va cham doi dau
% Case 1 : front corrupt in straight line
type = 0;
for i = 1:size(corruptWindow,1)
if (t_in >= corruptWindow(i,6) && t_in <= corruptWindow(i,7) && Y2 == corruptWindow(i,1) && X2 == corruptWindow(i,2)) || (t_out >= corruptWindow(i,6) && t_in <= corruptWindow(i,6) && Y1 == corruptWindow(i,3) && X1 == corruptWindow(i,4))
type = 1;
disp('Va cham doi dau 1');
elseif (t_out >= corruptWindow(i,6) && t_out <= corruptWindow(i,7) && Y2 == corruptWindow(i,1) && X2 == corruptWindow(i,2)) || (corruptWindow(i,7) >= t_in && corruptWindow(i,7) <= t_out && Y1 == corruptWindow(i,3) && X1 == corruptWindow(i,4))
type = 1;
disp('Va cham doi dau 2');
end
end
end