function [P]=AsympLegendreP(l,theta); % MATLAB HELP: % % function [P]=AsympLegendreP(l,theta); % % approximate legendre polynomial of degree evaluated at cos(theta) % % inputs: % l, angular degree % theta, the angle, this can be a vector of angles % outputs: % P, approximate legendre polynomial % % % see codes.ps or codes.pdf for details % % aaron birch, may 21, 2002 if (l<100) g=gamma(l+1)/gamma(l+3/2); else g=1/sqrt(l); end; k=g*sqrt(2/pi); P=k * cos( (l+1/2)*theta-pi/4)./sqrt(sin(theta));