58 |
|
odd(n) : .5*n - floor(.5*n) - .25; |
59 |
|
LegendreP(n,m,x) : if(m+.5, |
60 |
|
LegendreP2(n,m,x,sqrt(1-x*x)), |
61 |
< |
if(odd(-m),-1,1)*fact(n+m)/fact(n-m) * |
62 |
< |
LegendreP2(n,-m,x,sqrt(1-x*x)) |
61 |
> |
fact(n+m)/fact(n-m) * LegendreP2(n,-m,x,sqrt(1-x*x)) |
62 |
|
); |
63 |
|
{ SH normalization factor } |
64 |
|
SHnormF(l,m) : sqrt(0.25/PI*(2*l+1)*fact(l-m)/fact(l+m)); |
90 |
|
11 3 1 e |
91 |
|
... |
92 |
|
} |
93 |
< |
SH_B4(l,m,o,theta,phi) : if(m-.5, if(o, SphericalHarmonicYi(l,m,theta,phi), |
93 |
> |
SH_B4(l,m,o,theta,phi) : if(m-.5, sqrt(2) * |
94 |
> |
if(o, SphericalHarmonicYi(l,m,theta,phi), |
95 |
|
SphericalHarmonicYr(l,m,theta,phi)), |
96 |
< |
SHthetaF(l,0,theta) ); |
96 |
> |
SHthetaF(l,0,theta) ); |
97 |
|
SH_B3(l,r,theta,phi) : SH_B4(l,floor((r+1.00001)/2),odd(r+1),theta,phi); |
98 |
|
SH_B2(l,i,theta,phi) : SH_B3(l,i-l*l-1,theta,phi); |
99 |
|
SphericalHarmonicB(i,theta,phi) : SH_B2(ceil(sqrt(i)-1.00001),i,theta,phi); |