// vd = volume * delta_rho // besarg = q * R * sin(theta) // siarg = q * L/2 * cos(theta) static double _cyl(double vd, double besarg, double siarg) { return vd * sas_sinx_x(siarg) * sas_2J1x_x(besarg); } static double form_volume(double radius, double thickness, double length) { return M_PI*square(radius+thickness)*(length+2.0*thickness); } static double Iq(double q, double core_sld, double shell_sld, double solvent_sld, double radius, double thickness, double length) { // precalculate constants const double core_r = radius; const double core_h = 0.5*length; const double core_vd = form_volume(radius,0,length) * (core_sld-shell_sld); const double shell_r = (radius + thickness); const double shell_h = (0.5*length + thickness); const double shell_vd = form_volume(radius,thickness,length) * (shell_sld-solvent_sld); double total = 0.0; for (int i=0; i