#
#octave_functions_legendre.m
#
#https://octave-online.blogspot.com/search/label/functions_legendre
#
#P00(x)=1
#P10(x)=x
#P11(x)=(1-x^2)^1/2
#P20(x)=2/3x^2-1/2
#P21(x)=3x(1-x^2)^1/2
#P22(x)=3(1-x^2)
#P30(x)=5/2x^3-3/2x
#P31(x)=(3/2)(5x^2-1)(1-x^2)^1/2
#P32(x)=15x(1-x^2) 
#P33(x)=15(1-x^2)3/2
#
function out = octave_functions_legendre( l )

 X = linspace(-1,1,37);
 Y = legendre( l, X );
 MAXY = max( Y );
 MAXYY = max( MAXY );
 MINY = min( Y );
 MINYY = min( MINY );
 plot( X, Y )
 axis ([-1, 1, MINYY, MAXYY], "square");

 st="";
 for m=0:l
        st=[st,sprintf('P_%d^%d ',l,m)];
 end;
 title(st);

 out = l

endfunction
