function [l] = findele2(a,b,c,x,y)
% [l] = findele2(a,b,c,x,y);
%  findele2.m   Finds the element which contains x,y
% a,b,c are the element functions obtained by:
% [a, b, c] = elefunc(meshele,meshnod);
%
% [l] = findele(a,b,c,x,y);
% elel =meshele(l,:);
% elel(1) = elel(4);
% plot(meshnod(elel,2),meshnod(elel,3),'w') 


f1 = a(:,1)*x + b(:,1)*y + c(:,1);
l1 = find(f1<=1 & f1>0);

f2 = a(l1,2)*x + b(l1,2)*y + c(l1,2);
f3 = a(l1,3)*x + b(l1,3)*y + c(l1,3);
l = l1(  intersec(find(f2<=1 & f2>0),find(f3<=1 & f3>0)));

%elel =meshele(l,:);
%elel(1) = elel(4);
%plot(meshnod(elel,2),meshnod(elel,3),'w') 
