% given a triangle and two vertices which are not endpoints of a
% segment on the convex hull bounary, find the other triangle that
% contains these two vertices
function out=other_tri(a,b,n,tri)
N=size(tri,1);
for k=1:N
num(k)=length(intersect(tri(k,:),[a,b]));
end % for k
pos=find(num==2);
if pos(1)==n
out=pos(2);
else
out=pos(1);
end
return