function [delen,ip1,ip2] = getParts(nrPoints,index0)
%getParts get how the overlap divides into parts
%
% input
%   nrPoints = the number of points
%   index0   = the indices of points that coincide
%
% output
%   delen    = the number of parts that do not coincide
%   ip1      = the pointer to the begin of the middel part
%   ip2      = the pointer to the end of the middle part


%   000000111100000 delen = 2 
%   111110000001111 delen = 1
%
%  0:     the points of the ldb coincide with the other ldb
%  1:     the points do not coincide
%  delen: the number of non-coincide parts = parts with zero

i1         = ones(nrPoints,1)*NaN;
i1(index0) = 1; %lokaties waar de andere ldb ook waarden heeft
%vindt de delen waar er GEEN overlap is in r1
if isnan(i1(1))
    %gebied waar er wel overlap is
    delen = 2;
    ip1 = 0;
    for n = 1 : nrPoints
        if ~isnan(i1(n))
            if ip1 == 0
                ip1 = n;
                ip2 = n;
            else
                ip2 = n;
            end
        end
    end
else
    %gebied waar er geen overlap is
    delen = 1;
    ip1 = 0;
    for n = 1 : nrPoints
        if isnan(i1(n))
            if ip1 == 0
                ip1 = n;
                ip2 = n;
            else
                ip2 = n;
            end
        end
    end
end



end