
function pts=expanded_chebyshev(n,a,b)

% n: NUMBER OF POINTS.

% EXAMPLE:

% >> pts=expanded_chebyshev(5)
% pts =
%     -1.0000e+00
%     -6.1803e-01
%     6.4383e-17
%     6.1803e-01
%     1.0000e+00
% >>


%  #|LEB. CONST.| VAND. DET.|CONDEST VDM|
%  2|1.24999e+00|4.00000e+00|3.00000e+00|
%  3|1.42987e+00|9.09668e+00|5.32843e+00|
%  4|1.56951e+00|2.30835e+01|5.92008e+00|
%  5|1.68345e+00|6.42277e+01|7.55561e+00|
%  6|1.78196e+00|1.93344e+02|7.00000e+00|
%  7|1.86437e+00|6.23282e+02|9.86883e+00|
%  8|1.93672e+00|2.13461e+03|1.16914e+01|
%  9|2.00827e+00|7.71735e+03|1.26172e+01|
% 10|2.04959e+00|2.93010e+04|1.36625e+01|
% 11|2.12341e+00|1.16331e+05|1.52909e+01|
% 12|2.15815e+00|4.81220e+05|1.63845e+01|
% 13|2.20698e+00|2.06768e+06|1.75344e+01|
% 14|2.24807e+00|9.20381e+06|1.50000e+01|
% 15|2.29100e+00|4.23439e+07|2.01600e+01|
% 16|2.34487e+00|2.00942e+08|2.17996e+01|
% 17|2.36934e+00|9.81818e+08|2.28543e+01|
% 18|2.39604e+00|4.93144e+09|2.45196e+01|
% 19|2.43051e+00|2.54259e+10|2.51676e+01|
% 20|2.45990e+00|1.34394e+11|2.68088e+01|

if nargin == 1
    a=-1; b=1;
end

% DE BOOR: A practical guide to splines, 2001, pag. 21.

j=1:n; j=j';
term=cos((2*j-1)*pi/(2*n))./cos(pi/(2*n));
pts=(a+b-(a-b)*term)/2;
pts=sort(pts);