octave_functions_SphericalHarmonic_ReY
Function: octave_functions_SphericalHarmonic_ReY ( l, m )
function out = octave_functions_SphericalHarmonic_ReY( l, m ) seg=64; theta=linspace(0,pi,seg); phi=linspace(0,2*pi,seg); Theta=theta'*ones(1,seg); Phi=ones(seg,1)*phi; x=sin(Theta).*cos(Phi); y=sin(Theta).*sin(Phi); z=cos(Theta); L=legendre(l,cos(theta)); am=abs(m); LL=L(abs(m)+1,:); c=(-1)^((m+am)/2)*sqrt((2*l+1)/(4*pi)*factorial(l-am)/factorial(l+am))*LL'*exp(1i*m*phi); cc=real(c); r=abs(cc); plot3(r.*x,r.*y,r.*z); out = l endfunction
Function: legendre ( n, x )
Compute the Legendre function of degree n and order m = 0 … n. The value n must be a real non-negative integer. x is a vector with real-valued elements in the range [-1, 1].