22 FormFactorFullSpheroid::FormFactorFullSpheroid(
const std::vector<double> P)
25 "ellipsoid of revolution",
26 {{
"Radius",
"nm",
"revolution radius", 0, +INF, 0},
27 {
"Height",
"nm",
"height = twice the radius in non-revolution direction", 0, +INF, 0}}},
29 m_radius(m_P[0]), m_height(m_P[1])
34 FormFactorFullSpheroid::FormFactorFullSpheroid(
double radius,
double height)
41 double h = m_height / 2;
46 complex_t qR = sqrt(R * R * (q.
x() * q.
x() + q.
y() * q.
y()) + h * h * q.
z() * q.
z());
48 complex_t zFactor =
exp_I(h * q.
z());
50 if (std::abs(qR) < 1e-4)
52 return 4 * M_PI / 3 * R * R * h * (1. - 0.1 * pow(qR, 2)) * zFactor;
54 return 4 * M_PI / pow(qR, 3) * R * R * h * (sin(qR) - qR * cos(qR)) * zFactor;
60 double flattening = m_height / (2.0 * m_radius);
64 return createTransformedFormFactor(slicedff, rot, effects.position);
70 std::make_unique<TruncatedEllipsoid>(m_radius, m_radius, m_height / 2.0, m_height, 0.0);
complex_t exp_I(complex_t z)
Returns exp(I*z), where I is the imaginary unit.
Defines M_PI and some more mathematical constants.
Defines namespace MathFunctions.
Defines class TruncatedEllipsoid.
T z() const
Returns z-component in cartesian coordinate system.
T y() const
Returns y-component in cartesian coordinate system.
T x() const
Returns x-component in cartesian coordinate system.
Pure virtual interface for rotations.
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.