Changeset 2b9e63f in sasmodels for sasmodels/models/cylinder.c


Ignore:
Timestamp:
Oct 19, 2016 7:36:31 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
217590b
Parents:
b829b16 (diff), 9cc7fca (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ticket776

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/cylinder.c

    r9cc7fca rb829b16  
    1818    const double qr = q*radius; 
    1919    const double qh = q*0.5*length;  
    20     return  sas_J1c(qr*sn) * sinc(qh*cn) ; 
     20    return sas_J1c(qr*sn) * sinc(qh*cn); 
    2121} 
    2222 
     
    5858    double phi) 
    5959{ 
    60     double sn, cn; // slots to hold sincos function output 
    61  
    62     // Compute angle alpha between q and the cylinder axis 
    63     SINCOS(phi*M_PI_180, sn, cn); 
    64     const double q = sqrt(qx*qx + qy*qy); 
    65     const double cos_val = (q==0. ? 1.0 : (cn*qx + sn*qy)*sin(theta*M_PI_180)/q); 
    66  
    67     const double alpha = acos(cos_val); 
    68  
    69     SINCOS(alpha, sn, cn); 
     60    double q, sin_alpha, cos_alpha; 
     61    ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 
     62    //printf("sn: %g cn: %g\n", sin_alpha, cos_alpha); 
    7063    const double s = (sld-solvent_sld) * form_volume(radius, length); 
    71     return 1.0e-4 * square(s * fq(q, sn, cn, radius, length)); 
     64    const double form = fq(q, sin_alpha, cos_alpha, radius, length); 
     65    return 1.0e-4 * square(s * form); 
    7266} 
Note: See TracChangeset for help on using the changeset viewer.