ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/SHAPES/SHFunc.cpp
(Generate patch)

Comparing trunk/SHAPES/SHFunc.cpp (file contents):
Revision 1300 by gezelter, Thu Jun 24 19:06:47 2004 UTC vs.
Revision 1309 by chrisfen, Fri Jun 25 20:10:53 2004 UTC

# Line 7 | Line 7 | double SHFunc::getValueAt(double costheta, double phi)
7  
8   double SHFunc::getValueAt(double costheta, double phi) {
9  
10 <  double f, p, phase;
10 >  double p, phase;
11  
12  // incredibly inefficient way to get the normalization
13
14  // normalization factor:
15  f = sqrt( (2*L+1)/(4.0*M_PI) * Fact(L-M) / Fact(L+M) );
12    // associated Legendre polynomial
13    p = LegendreP(L,M,costheta);
14    
# Line 22 | Line 18 | double SHFunc::getValueAt(double costheta, double phi)
18      phase = cos((double)M * phi);
19    }
20    
21 <  return coefficient*f*p*phase;
21 >  return coefficient*p*phase;
22  
23   }
24   //-----------------------------------------------------------------------------//
# Line 75 | Line 71 | double SHFunc::Fact(double n) {
71    }
72   }
73  
78 double SHFunc::Fact(double n) {
79
80  if (n < 0.0) return NAN;
81  else {
82    if (n < 2.0) return 1.0;
83    else
84      return n*Fact(n-1.0);
85  }
86  
87 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines