function R=lagrangeP(X,Y,T)
    R=[]
    for j=1:length(T)
        res=0
        for i=1:length(X)
            pr=1
            for k=1:length(X)
                if X(k) <> X(i)
                    pr = pr * (T(j)-X(k))/(X(i)-X(k))
                end
            end
            res = res + Y(i)*pr
        end
        R=[R,res]        
    end
endfunction

function R=lagrangef(X,f,T)
    R=lagrangeP(X,f(X),T)
endfunction

function y=f(x)
    y=1 ./(1+25*x.^2)
endfunction

function R=racineTchebichev(n)
    R=[]
    for k=0:n-1
        R=[R,cos((2*k+1)*%pi/(2*n))]
    end
endfunction
