Changeset 3f832f9 in sasmodels


Ignore:
Timestamp:
Jan 7, 2016 11:46:36 AM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
a7f909a
Parents:
3c97ff0
Message:

code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/ellipsoid.c

    rd53d3cd r3f832f9  
    44    double rpolar, double requatorial, double theta, double phi); 
    55 
    6 double _ellipsoid_kernel(double q, double rpolar, double requatorial, double cos_alpha); 
    7 double _ellipsoid_kernel(double q, double rpolar, double requatorial, double cos_alpha) 
     6double _ellipsoid_kernel(double q, double rpolar, double requatorial, double sin_alpha); 
     7double _ellipsoid_kernel(double q, double rpolar, double requatorial, double sin_alpha) 
    88{ 
    99    double sn, cn; 
    1010    double ratio = rpolar/requatorial; 
    1111    const double u = q*requatorial*sqrt(1.0 
    12                    + cos_alpha*cos_alpha*(ratio*ratio - 1.0)); 
     12                   + sin_alpha*sin_alpha*(ratio*ratio - 1.0)); 
    1313    SINCOS(u, sn, cn); 
    1414    //const double f = ( u==0.0 ? 1.0 : 3.0*(sn-u*cn)/(u*u*u) ); 
     
    3535    double total = 0.0; 
    3636    for (int i=0;i<76;i++) { 
    37         //const double cos_alpha = (Gauss76Z[i]*(upper-lower) + upper + lower)/2; 
    38         const double cos_alpha = 0.5*(Gauss76Z[i] + 1.0); 
    39         total += Gauss76Wt[i] * _ellipsoid_kernel(q, rpolar, requatorial, cos_alpha); 
     37        //const double sin_alpha = (Gauss76Z[i]*(upper-lower) + upper + lower)/2; 
     38        const double sin_alpha = 0.5*(Gauss76Z[i] + 1.0); 
     39        total += Gauss76Wt[i] * _ellipsoid_kernel(q, rpolar, requatorial, sin_alpha); 
    4040    } 
    4141    //const double form = (upper-lower)/2*total; 
     
    5757    const double q = sqrt(qx*qx + qy*qy); 
    5858    SINCOS(theta*M_PI_180, sn, cn); 
     59    // TODO: check if this is actually sin(alpha), not cos(alpha) 
    5960    const double cos_alpha = cn*cos(phi*M_PI_180)*(qx/q) + sn*(qy/q); 
    6061    const double form = _ellipsoid_kernel(q, rpolar, requatorial, cos_alpha); 
Note: See TracChangeset for help on using the changeset viewer.