21 FormFactorFullSphere::FormFactorFullSphere(
const std::vector<double> P,
bool position_at_center)
22 :
IFormFactorBorn({
"FullSphere",
"sphere", {{
"Radius",
"nm",
"radius", 0, +INF, 0}}}, P),
23 m_radius(m_P[0]), m_position_at_center(position_at_center)
28 FormFactorFullSphere::FormFactorFullSphere(
double radius,
bool position_at_center)
35 if (m_position_at_center)
38 kvector_t new_centre = rotation.transformed(centre);
39 return new_centre.
z() - m_radius;
44 if (m_position_at_center)
47 kvector_t new_centre = rotation.transformed(centre);
48 return new_centre.
z() + m_radius;
54 if (!m_position_at_center)
55 ret *=
exp_I(q.
z() * m_radius);
64 m_position_at_center ?
kvector_t(0.0, 0.0, 0.0) : rot.transformed(center) - center;
65 kvector_t new_translation = translation + rotation_offset;
66 std::unique_ptr<IRotation> P_identity(IRotation::createIdentity());
67 double height = 2.0 * m_radius;
70 return createTransformedFormFactor(slicedff, *P_identity, effects.position);
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 IRotation classes.
T z() const
Returns z-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.
complex_t ffSphere(cvector_t q, double R)
Returns the form factor of a sphere of radius R.