function res = IntegrationTriangle(corners,func)

l1=0.20257301464691267760;  l2=0.94028412821023017954;
w1=0.062969590272413576298; w2=0.066197076394253090369;
w3=0.1125;         w=[w1,w1,w1,w2,w2,w2,w3];

G = [l1/2 l1/2; 1-l1,l1/2; l1/2, 1-l1;
     l2/2 l2/2; 1-l2,l2/2; l2/2, 1-l2; 1/3 1/3];

T = [corners(2,:)-corners(1,:);corners(3,:)-corners(1,:)];
#P=corners(1,:)+G*T
P = G*T; P(:,1) =  P(:,1)+corners(1,1); P(:,2) = P(:,2)+corners(1,2);
if ischar(func) val = feval(func,P);  else val = func(:); endif

res = w*val*abs(det(T));
end%function
