function [ x2, y2 ] = triangle_shrink ( x, y, s )
%
%  This function shrinks a triangle by the factor S.
%
%  X and Y are the coordinates of the vertices of the triangle.
%  S is the shrink factor, such as 0.5.
%
%  X2 and Y2 are the coordinates of the shrunken triangle.
%

%
%  Compute the coordinates of the centroid.
%
  xc = mean ( x );
  yc = mean ( y );

  x2(1:3) = xc + s * ( x(1:3) - xc );
  y2(1:3) = yc + s * ( y(1:3) - yc );

  return
end
