function InterpolaceCebysevova_abs()

a = -5; b = 5;

N = 100;

for n=0:N
    xvlnka = cos(pi*(2*[0:n]+1)/(2*(n+1)));
    x = (a+b)/2 + xvlnka*(b-a)/2;
    
    f = abs(x);
    
    xx = a:0.1:b;
    fn = xx; fn(:) = 0;
    for j=0:n
        Lj = xx; Lj(:) = 1;
        for k=0:n
            if j==k
                continue;
            end
            Lj = Lj .* ((xx-x(k+1)))./(x(j+1)-x(k+1));
        end
        fn = fn + f(j+1)*Lj;
    end
    n
    plot(xx,fn,'r',xx,abs(xx),'k')
    pause
end