/** * Scattering intensity for dispersed CEllipsoidModel * * WARNING: THIS FILE WAS GENERATED BY IGORGENERATOR.PY * DO NOT MODIFY THIS FILE, MODIFY ellipsoid.h * AND RE-RUN THE GENERATOR SCRIPT * * This code was written as part of the DANSE project * http://danse.us/trac/sans/ * * Copyright 2007: University of Tennessee, for the DANSE project */ #include "ellipsoid.h" #include #include "libCylinder.h" #include "libSphere.h" #include "c_disperser.h" /** * Function to evaluate 2D scattering function * * @param dp: parameters of the function * @param q: q-value * @param phi: angle of the q-vector in the plane of the detector, relative to q_x * @return: function value */ double oriented_ellipsoid_2D(double pars[], double q, double phi) { EllipsoidParameters danse_pars; // List of default parameters: // pars[0]: scale = 1.0 // pars[1]: radius_a = 20.0 A // pars[2]: radius_b = 400.0 A // pars[3]: contrast = 3e-06 A-2 // pars[4]: background = 0.0 cm-1 // pars[5]: axis_theta = 1.57 rad // pars[6]: axis_phi = 0.0 rad danse_pars.scale = pars[0]; danse_pars.radius_a = pars[1]; danse_pars.radius_b = pars[2]; danse_pars.contrast = pars[3]; danse_pars.background = pars[4]; danse_pars.axis_theta = pars[5]; danse_pars.axis_phi = pars[6]; return ellipsoid_analytical_2D(&danse_pars, q, phi); } /** * Function to evaluate dispersed 2D scattering function * * @param dp: parameters of the function * @param q: q-value * @param phi: angle of the q-vector in the plane of the detector, relative to q_x * @return: function value * // List of default parameters: // pars[0]: scale = 1.0 // pars[1]: radius_a = 20.0 A // pars[2]: radius_b = 400.0 A // pars[3]: contrast = 3e-06 A-2 // pars[4]: background = 0.0 cm-1 // pars[5]: axis_theta = 1.57 rad // pars[6]: axis_phi = 0.0 rad // pars[7]: dispersion of radius_a // pars[8]: dispersion of radius_b // pars[9]: dispersion of axis_theta // pars[10]: dispersion of axis_phi // pars[11]: number of points in dispersion curve */ double disperse_ellipsoid_analytical_2D(double dp[], double q, double phi) { int paramList[4]; double sigmaList[4]; int npts; int i; double pars[12]; // radius_a paramList[0] = 1; // radius_b paramList[1] = 2; // axis_theta paramList[2] = 5; // axis_phi paramList[3] = 6; sigmaList[0] = dp[7]; sigmaList[1] = dp[8]; sigmaList[2] = dp[9]; sigmaList[3] = dp[10]; npts = (int)(floor(dp[11])); // Internal copy of parameters for(i=0; i<12; i++ ) { pars[i] = dp[i]; } return c_disperser( &oriented_ellipsoid_2D, pars, 4, paramList, sigmaList, npts, q, phi ); }