Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/capped_cylinder.c

    r71b751d ree60aa7  
    8484} 
    8585 
     86static double 
     87radius_from_volume(double radius, double radius_cap, double length) 
     88{ 
     89    const double vol_cappedcyl = form_volume(radius,radius_cap,length); 
     90    return cbrt(0.75*vol_cappedcyl/M_PI); 
     91} 
     92 
     93static double 
     94radius_from_totallength(double radius, double radius_cap, double length) 
     95{ 
     96    const double hc = radius_cap - sqrt(radius_cap*radius_cap - radius*radius); 
     97    return 0.5*length + hc; 
     98} 
     99 
     100static double 
     101effective_radius(int mode, double radius, double radius_cap, double length) 
     102{ 
     103    switch (mode) { 
     104    case 1: // equivalent sphere 
     105        return radius_from_volume(radius, radius_cap, length); 
     106    case 2: // radius 
     107        return radius; 
     108    case 3: // half length 
     109        return 0.5*length; 
     110    case 4: // half total length 
     111        return radius_from_totallength(radius, radius_cap,length); 
     112    } 
     113} 
     114 
    86115static void 
    87116Fq(double q,double *F1, double *F2, double sld, double solvent_sld, 
Note: See TracChangeset for help on using the changeset viewer.