function Ts = stretch(T,s);
% Ts = stretch([P,Q,R],s)
%
% stretch triangle by factor s with respect to centroid
% P,Q,R are column vectors of length 2 or 3
% columns of Ts are vertices of stretched triangle

P = T(:,1); Q = T(:,2); R = T(:,3);
C = (P+Q+R)/3;      % centroid of triangle
Ts = [C+s*(P-C), C+s*(Q-C), C+s*(R-C)];

