#define INVALID(v) (v.radius<0 || v.length<0) static double form_volume(double radius, double length) { return M_PI*radius*radius*length; } static double _fq(double qab, double qc, double radius, double length) { return sas_2J1x_x(qab*radius) * sas_sinx_x(qc*0.5*length); } static void Fq(double q, double *F1, double *F2, double sld, double solvent_sld, double radius, double length) { // translate a point in [-1,1] to a point in [0, pi/2] const double zm = M_PI_4; const double zb = M_PI_4; double total_F1 = 0.0; double total_F2 = 0.0; for (int i=0; i