function [lambda_n,points]=leb_constant(a,b,n,x,w)
%------------------------------------------------------------------
% This function computes the Lebesgue constant of F-H interpolant on [a,b].
%
%INPUTS:
%a,b - endpoints of the interval
%n - number of nodes
%x - vector of nodes
%w - vector of F-H weights
%
%OUTPUTS:
%lamda_n - Lebesgue constant
%points - vector of equidistant points
%
%-----------------------------------------------------------------
% Authors: 
%      Stefano De Marchi and Cinzia Bandiziol
%      Department of Pure and Applied Math.
%      University of Padova
%           
% Version: May 2015		
%  ----------------------------------------------------------------								
N=5000;
points=linspace(a,b,N)';
C=eval_bi(x,w,points);%bi function evaluating at points
lambda_n=norm(C,1);%Lebesgue function evaluating at points