
function showc( v, st );

%
% showc( v, st )
% Shows the car positions in the circle track.
% v is the parameter vector [p1 v1 a1 p2 v2 a2]
% st is the elapsed simulation time.
%

p1 = v(1,1); p2 = v(1,4);
v1 = v(1,2); v2 = v(1,5);
a1 = v(1,3); a2 = v(1,6);

c = 0:0.01:2*pi;
s = 1000/(2*pi);
p1 = p1*2*pi/1000;
p2 = p2*2*pi/1000;

clf;
hold off;
axis('square');
axis([-1 1000/(pi)+1 -1 1000/(pi)+1]);
hold on;

plot(s*(1+sin(c)),s*(1+cos(c)),'.',s*(1+sin(p1)),s*(1+cos(p1)),'wo', ...
     s*(1+sin(p2)),s*(1+cos(p2)),'w*');
title('Car Following Simulator -- Car1=o  Car2=*');
xl = sprintf('v1=%6.2fm/s; v2=%6.2fm/s; time=%6.1fs', v1, v2, st+0.1);
yl = sprintf('Meters');
% yl = sprintf('<--------------    318  m    ------------->');
xlabel(xl); ylabel(yl);
pause(0.1);
