Changes in sasmodels/models/core_shell_cylinder.c [71b751d:ee60aa7] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_cylinder.c
r71b751d ree60aa7 11 11 { 12 12 return M_PI*square(radius+thickness)*(length+2.0*thickness); 13 } 14 15 static double 16 radius_from_volume(double radius, double thickness, double length) 17 { 18 const double volume_outer_cyl = form_volume(radius,thickness,length); 19 return cbrt(0.75*volume_outer_cyl/M_PI); 20 } 21 22 static double 23 radius_from_diagonal(double radius, double thickness, double length) 24 { 25 const double radius_outer = radius + thickness; 26 const double length_outer = length + 2.0*thickness; 27 return sqrt(radius_outer*radius_outer + 0.25*length_outer*length_outer); 28 } 29 30 static double 31 effective_radius(int mode, double radius, double thickness, double length) 32 { 33 switch (mode) { 34 case 1: // equivalent sphere 35 return radius_from_volume(radius, thickness, length); 36 case 2: // outer radius 37 return radius + thickness; 38 case 3: // half outer length 39 return 0.5*length + thickness; 40 case 4: // half min outer length 41 return (radius < 0.5*length ? radius + thickness : 0.5*length + thickness); 42 case 5: // half max outer length 43 return (radius > 0.5*length ? radius + thickness : 0.5*length + thickness); 44 case 6: // half outer diagonal 45 return radius_from_diagonal(radius,thickness,length); 46 } 13 47 } 14 48
Note: See TracChangeset
for help on using the changeset viewer.