function [Uzly,Segmenty] = diskretizace_elektrostatika2_MHP(polomerOmegar,sirkaOmegaPlusMinus,vyskaOmegaPlusMinus,x1OmegaPlus,h)

obvodr = 2*pi*polomerOmegar;
nr = floor(obvodr/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
%
deltat = 2*pi/nr;
t = 0:deltat:2*pi;
Uzly = [cos(t);sin(t)];
idxUzly = nr+1;

%
% 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)) ];
  