function [Uzly,Segmenty] = diskretizace_elektrostatika_MHP(sirkaOmegar,vyskaOmegar,sirkaOmegaPlusMinus,vyskaOmegaPlusMinus,x1OmegaPlus,h)

nr = 2 * ( floor(vyskaOmegar/h) + floor(sirkaOmegar/h) );
nPlusMinus = 2 * ( floor(vyskaOmegaPlusMinus/h) + floor(sirkaOmegaPlusMinus/h) );

Uzly = zeros(2, nr + 2*nPlusMinus );
Segmenty{1} = [ [1:nr] ; [2:nr,1] ];                      % Gammar
Segmenty{2} = [ [1:nPlusMinus] ; [2:nPlusMinus,1] ] + nr; % GammaPlus
Segmenty{3} = Segmenty{2} + nPlusMinus;                   % GammaMinus

%
% Uzly Gama^r
%
x = [sirkaOmegar/2;-vyskaOmegar/2];
% smer nahoru
n = floor(vyskaOmegar/h);
Uzly(:,1) = x;
idxUzly = 2;
for i=1:n
    x(2) = x(2) + h;
    Uzly(:,idxUzly) = x;
    idxUzly = idxUzly+1;
end
% smer doleva
n = floor(sirkaOmegar/h);
for i=1:n
    x(1) = x(1) - h;
    Uzly(:,idxUzly) = x;
    idxUzly = idxUzly+1;
end
% smer dolu
n = floor(vyskaOmegar/h);
for i=1:n
    x(2) = x(2) - h;
    Uzly(:,idxUzly) = x;
    idxUzly = idxUzly+1;
end
% smer doprava
n = floor(sirkaOmegar/h);
for i=1:n-1
    x(1) = x(1) + h;
    Uzly(:,idxUzly) = x;
    idxUzly = idxUzly+1;
end


%
% Uzly Gama^+
%
x = [x1OmegaPlus+sirkaOmegaPlusMinus;-vyskaOmegaPlusMinus/2];
% smer nahoru
n = floor(vyskaOmegaPlusMinus/h);
Uzly(:,idxUzly) = x;
idxUzly = idxUzly+1;
for i=1:n
    x(2) = x(2) + h;
    Uzly(:,idxUzly) = x;
idxUzly = idxUzly+1;
end
% smer doleva
n = floor(sirkaOmegaPlusMinus/h);
for i=1:n
    x(1) = x(1) - h;
    Uzly(:,idxUzly) = x;
    idxUzly = idxUzly+1;
end
% smer dolu
n = floor(vyskaOmegaPlusMinus/h);
for i=1:n
    x(2) = x(2) - h;
    Uzly(:,idxUzly) = x;
    idxUzly = idxUzly+1;
end
% smer doprava
n = floor(sirkaOmegaPlusMinus/h);
for i=1:n-1
    x(1) = x(1) + h;
    Uzly(:,idxUzly) = x;
    idxUzly = idxUzly+1;
end


%
% Uzly Gama^-
%
Uzly(:,(nr+nPlusMinus+1):(nr+2*nPlusMinus)) = ...
    [ Uzly(1,(nr+1):(nr+nPlusMinus))-(sirkaOmegaPlusMinus+2*x1OmegaPlus) ; ...
      Uzly(2,(nr+1):(nr+nPlusMinus)) ];
  