function trio = CS4640_tri_max_dist(tri,x,y)
%

num_tri = length(tri(:,1));

trio = [tri,zeros(num_tri,1)];
d = zeros(1,3);
for t = 1:num_tri
    ind1 = tri(t,1);
    ind2 = tri(t,2);
    ind3 = tri(t,3);
    pt1 = [x(ind1),y(ind1)];
    pt2 = [x(ind2),y(ind2)];
    pt3 = [x(ind3),y(ind3)];
    d(1) = norm(pt1-pt2);
    d(2) = norm(pt1-pt3);
    d(3) = norm(pt2-pt3);
    trio(t,4) = max(d);
end
