Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/barbell.c

    rd42dd4a r99658f6  
    6363 
    6464static double 
     65radius_from_excluded_volume(double radius_bell, double radius, double length) 
     66{ 
     67    const double hdist = sqrt(square(radius_bell) - square(radius)); 
     68    const double length_tot = length + 2.0*(hdist+ radius); 
     69    return 0.5*cbrt(0.75*radius_bell*(2.0*radius_bell*length_tot + (radius_bell + length_tot)*(M_PI*radius_bell + length_tot))); 
     70} 
     71 
     72static double 
    6573radius_from_volume(double radius_bell, double radius, double length) 
    6674{ 
     
    8189    switch (mode) { 
    8290    default: 
    83     case 1: // equivalent sphere 
     91    case 1: // equivalent cylinder excluded volume 
     92        return radius_from_excluded_volume(radius_bell, radius , length); 
     93    case 2: // equivalent volume sphere 
    8494        return radius_from_volume(radius_bell, radius , length); 
    85     case 2: // radius 
     95    case 3: // radius 
    8696        return radius; 
    87     case 3: // half length 
     97    case 4: // half length 
    8898        return 0.5*length; 
    89     case 4: // half total length 
     99    case 5: // half total length 
    90100        return radius_from_totallength(radius_bell,radius,length); 
    91101    } 
Note: See TracChangeset for help on using the changeset viewer.