This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | |
double | plgndr (int l, int m, double x) |
double | sphericalY (int l, int m, double theta) |
|
Definition at line 9 of file plgndr.c. Referenced by sphericalY().
00010 { 00011 double fact,pll,pmm,pmmp1,somx2; 00012 int i,ll; 00013 00014 if (m < 0 || m > l || fabs(x) > 1.0) { 00015 fprintf(stderr, "Bad arguments in routine plgndr()\n"); 00016 fprintf(stderr, "l: %d m: %d x: %g\n", l, m, x); 00017 exit(1); 00018 } 00019 pmm=1.0; 00020 if (m > 0) { 00021 somx2=sqrt((1.0-x)*(1.0+x)); 00022 fact=1.0; 00023 for (i=1;i<=m;i++) { 00024 pmm *= -fact*somx2; 00025 fact += 2.0; 00026 } 00027 } 00028 if (l == m) 00029 return pmm; 00030 else { 00031 pmmp1=x*(2*m+1)*pmm; 00032 if (l == (m+1)) 00033 return pmmp1; 00034 else { 00035 for (ll=m+2;ll<=l;ll++) { 00036 pll=(x*(2*ll-1)*pmmp1-(ll+m-1)*pmm)/(ll-m); 00037 pmm=pmmp1; 00038 pmmp1=pll; 00039 } 00040 return pll; 00041 } 00042 } 00043 } |
|
Definition at line 46 of file plgndr.c. Referenced by inifusion(), initorus(), and main().
|