Matlab script if you're as crazy as I am and want to calculate it for your own browser:
Code Select
function cars(width, maxTime, v1, v2, v3, tolerance)
t = 0 : 1 : maxTime;
p1 = width * ( (v1 * t / width) - floor (v1 * t / width));
p2 = width * ( (v2 * t / width) - floor (v2 * t / width));
p3 = width * ( (v3 * t / width) - floor (v3 * t / width));
for i = 1 : maxTime;
if (abs(p1(i) - p2(i)) < tolerance && abs(p2(i) - p3(i)) < tolerance && abs(p1(i) - p3(i)) < tolerance)
disp (i);
end
end
%plot(t, p1, t, p2, t, p3);
end