Changes in sasmodels/models/core_shell_cylinder.c [0d6e865:5bddd89] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_cylinder.c
r0d6e865 r5bddd89 11 11 double _cyl(double twovd, double besarg, double siarg) 12 12 { 13 const double bj = (besarg == 0.0 ? 0.5 : 0.5*sas_J1c(besarg)); 14 const double si = (siarg == 0.0 ? 1.0 : sin(siarg)/siarg); 15 return twovd*si*bj; 13 return twovd * sinc(siarg) * sas_J1c(besarg); 16 14 } 17 15 18 16 double form_volume(double radius, double thickness, double length) 19 17 { 20 return M_PI*(radius+thickness)*(radius+thickness)*(length+2 *thickness);18 return M_PI*(radius+thickness)*(radius+thickness)*(length+2.0*thickness); 21 19 } 22 20 … … 66 64 double phi) 67 65 { 68 double sn, cn; // slots to hold sincos function output 69 70 // Compute angle alpha between q and the cylinder axis 71 SINCOS(phi*M_PI_180, sn, cn); 72 // # The following correction factor exists in sasview, but it can't be 73 // # right, so we are leaving it out for now. 74 // const double correction = fabs(cn)*M_PI_2; 75 const double q = sqrt(qx*qx+qy*qy); 76 const double cos_val = (q==0. ? 1.0 : (cn*qx + sn*qy)*sin(theta*M_PI_180)/q); 77 const double alpha = acos(cos_val); 66 double q, sin_alpha, cos_alpha; 67 ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 78 68 79 69 const double core_qr = q*radius; … … 86 76 * (shell_sld-solvent_sld); 87 77 88 SINCOS(alpha, sn, cn); 89 const double fq = _cyl(core_twovd, core_qr*sn, core_qh*cn) 90 + _cyl(shell_twovd, shell_qr*sn, shell_qh*cn); 78 const double fq = _cyl(core_twovd, core_qr*sin_alpha, core_qh*cos_alpha) 79 + _cyl(shell_twovd, shell_qr*sin_alpha, shell_qh*cos_alpha); 91 80 return 1.0e-4 * fq * fq; 92 81 }
Note: See TracChangeset
for help on using the changeset viewer.