Changeset 99658f6 in sasmodels for sasmodels/models/capped_cylinder.c
- Timestamp:
- Nov 6, 2018 2:10:43 PM (5 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- cf3d0ce
- Parents:
- 5024a56
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/capped_cylinder.c
rd42dd4a r99658f6 85 85 86 86 static double 87 radius_from_excluded_volume(double radius, double radius_cap, double length) 88 { 89 const double hc = radius_cap - sqrt(radius_cap*radius_cap - radius*radius); 90 const double length_tot = length + 2.0*hc; 91 return 0.5*cbrt(0.75*radius*(2.0*radius*length_tot + (radius + length_tot)*(M_PI*radius + length_tot))); 92 } 93 94 static double 87 95 radius_from_volume(double radius, double radius_cap, double length) 88 96 { … … 103 111 switch (mode) { 104 112 default: 105 case 1: // equivalent sphere 113 case 1: // equivalent cylinder excluded volume 114 return radius_from_excluded_volume(radius, radius_cap, length); 115 case 2: // equivalent volume sphere 106 116 return radius_from_volume(radius, radius_cap, length); 107 case 2: // radius117 case 3: // radius 108 118 return radius; 109 case 3: // half length119 case 4: // half length 110 120 return 0.5*length; 111 case 4: // half total length121 case 5: // half total length 112 122 return radius_from_totallength(radius, radius_cap,length); 113 123 }
Note: See TracChangeset
for help on using the changeset viewer.