function dists = UAM_STLD3D(aa,lane1,lane2,del_x)
%

endpt11 = aa.lanes(lane1,1:3);
endpt12 = aa.lanes(lane1,4:6);
dir1 = endpt12 - endpt11;
dir1 = dir1/norm(dir1);
endpt21 = aa.lanes(lane2,1:3);
endpt22 = aa.lanes(lane2,4:6);
dir2 = endpt22 - endpt21;
dir2 = dir2/norm(dir2);
length1 = aa.lane_lengths(lane1);
length2 = aa.lane_lengths(lane2);
x1 = [0:del_x:length1];
if x1(end)~=length1
    x1 = [x1,length1];
end
x2 = [0:del_x:length2];
if x2(end)~=length2
    x2 = [x2,length2];
end

num1 = length(x1);
num2 = length(x2);
dists = zeros(num1,num2);

for ind1 = 1:num1
    d1 = x1(ind1);
    for ind2 = 1:num2
        d2 = x2(ind2);
        P1 = endpt11 + d1*dir1;
        P2 = endpt21 + d2*dir2;
        dists(ind1,ind2) = norm(P1-P2);
    end
end
tch = 0;
