
function d = distance( v, pv );

%
% d = distance( v, pv )
% Calculates the distance between two cars
% (from car2 to car1).
% 

p1 = v(1,1); p2 = v(1,4);
trl = pv(1,8);
d = p1-p2;
if d<0, d=trl+d; end

