Changeset d277229 in sasmodels for sasmodels/models/cylinder.c
- Timestamp:
- Sep 7, 2018 5:29:38 AM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 3c60146
- Parents:
- 2a12351b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/cylinder.c
r71b751d rd277229 11 11 { 12 12 return sas_2J1x_x(qab*radius) * sas_sinx_x(qc*0.5*length); 13 } 14 15 static double 16 radius_from_volume(double radius, double length) 17 { 18 return cbrt(0.75*radius*radius*length); 19 } 20 21 static double 22 radius_from_diagonal(double radius, double length) 23 { 24 return sqrt(radius*radius + 0.25*length*length); 25 } 26 27 static double 28 effective_radius(int mode, double radius, double length) 29 { 30 if (mode == 1) { 31 return radius_from_volume(radius, length); 32 } else if (mode == 2) { 33 return radius; 34 } else if (mode == 3) { 35 return 0.5*length; 36 } else if (mode == 4) { 37 return (radius < 0.5*length ? radius : 0.5*length); 38 } else if (mode == 5) { 39 return (radius > 0.5*length ? radius : 0.5*length); 40 } else { 41 return radius_from_diagonal(radius,length); 42 } 13 43 } 14 44
Note: See TracChangeset
for help on using the changeset viewer.