function P = LagrangeJo (X, Y)
#  X = [-1 0 1 2 3]
#  Y = [8 6 7 -4 0]
  P = zeros(1,length(X));
    
  for i=1:length(X)   
      szamlalo = poly(X([1:i-1, i+1:end]));
      nevezo = polyval(szamlalo, X(i))
      Li = szamlalo / nevezo
      P = P+Li*Y(i);
  end
  
#  ans = [1.75000  -6.00000  -0.25000   5.50000   6.00000]
endfunction
