function prikladLaplace2d()

u = @(X) (X(1,:)+X(2,:));

h = 0.05;
rad = 10;
  
rohy = 0.25 * [[-1;-1] [1;-1] [1;1] [-1;1]];
[P,E] = discretizePolygon(rohy,h);
n = size(E,2);

V = BEM2dLaplace(P,E,10); %operatorV2dLaplace(P,E,rad);

% prava strana
b = zeros(n,1);
for j=1:n
  Aj = P(:,E(1,j));
  Bj = P(:,E(2,j));
  b(j) = u(Aj+Bj) * norm(Bj-Aj);
end

q = V\b;

midP = (P(:,E(1,:))+P(:,E(2,:)))/2;
plot3(midP(1,:),midP(2,:),q')

x = -1:0.1:1;
[X,Y] = meshgrid(x,x);

Vq = BEM2dLaplace_potentials(P,E,rad,q,zeros(n,1),[X(:)';Y(:)']);
VQ = X; VQ(:) = Vq;
surf(X,Y,VQ)
