function [vgitg,tgitg]=elemb(ii,jj,xk,yk,h,celnel,ieltop,X,Y)

xn=celnel(jj,3);
yn=celnel(jj,4);
iA=ieltop(jj,1);
jA=ieltop(jj,2);
iB=ieltop(jj,3);
jB=ieltop(jj,4);
xA=X(iA,jA);
yA=Y(iA,jA);
xB=X(iB,jB);
yB=Y(iB,jB);
hx=(xB-xA)/10;
hy=(yB-yA)/10;

if (ii==jj)
    vgitg=-h/2/pi*(log(h/2)-1);
    tgitg=0;
else
    xx=linspace(xA,xB,11);
    yy=linspace(yA,yB,11);
    rr2=(xx-ones(1,11)*xk).^2+(yy-ones(1,11)*yk).^2;
    vg=-1/4/pi*log(rr2);
    tg=-1/2/pi*((xx-ones(1,11)*xk)*xn+(yy-ones(1,11)*yk)*yn)./rr2;
    vgitg=(sum(vg)-vg(1)/2-vg(end)/2)*h/10;
    tgitg=(sum(tg)-tg(1)/2-tg(end)/2)*h/10;
end