function Vt = potencial1Vrstvy2dLaplace(nodes,edges,t,volPoints,order)

load GaussQuadratureForLineSegments.mat

tau  = points{order};
w = weights{order};

m = size(edges,2);
n = size(volPoints,2);

Vt = zeros(1,n);

for i=1:n
    xi1 = volPoints(:,i);

    for j=1:m
        edgej = edges(:,j);
        nodesj = nodes(:,edgej);
        xj1 = nodesj(:,1);
        xj2 = nodesj(:,2);
        tj = xj2-xj1;
        Sj = norm(tj);

        a = xi1-xj1;

        AB1 = a(1)-tj(1)*tau;
        AB2 = a(2)-tj(2)*tau;
        norm1 = sqrt(AB1.^2+AB2.^2);
        F = log(norm1);
        Vt(i) = Vt(i) + t(j) * Sj*w*F';
        
    end
    
end

Vt = Vt/(-2*pi);
