function prikladHelmholtz2d()

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

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

V = BEM2dHelmholtz(kappa,P,E,10);

% 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,:),real(q)')

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

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