diff --git a/Core/Aggregate/FTDecayFunctions.cpp b/Core/Aggregate/FTDecayFunctions.cpp index c6739578907c63e530310112644c9d1e0585c9b0..b3098199cac2907808693eaea296a98d6f191033 100644 --- a/Core/Aggregate/FTDecayFunctions.cpp +++ b/Core/Aggregate/FTDecayFunctions.cpp @@ -144,19 +144,15 @@ double FTDecayFunction1DCosine::evaluate(double q) const //! @param gamma: distribution orientation with respect to the corresponding lattice vector //! in radians IFTDecayFunction2D::IFTDecayFunction2D(double decay_length_x, double decay_length_y, double gamma) - : m_decay_length_x(decay_length_x), m_decay_length_y(decay_length_y), m_gamma(gamma), - m_delta(M_PI_2) -{ -} + : m_decay_length_x(decay_length_x), m_decay_length_y(decay_length_y), m_gamma(gamma) +{} void IFTDecayFunction2D::transformToStarBasis(double qX, double qY, double alpha, double a, double b, double& qa, double& qb) const { - double prefactor = 1.0 / M_TWOPI; // divide by sin(m_delta) - // for unnormalized X*,Y* basis - qa = a * prefactor * (std::sin(m_gamma + m_delta) * qX - std::sin(m_gamma) * qY); - qb = b * prefactor - * (-std::sin(alpha - m_gamma - m_delta) * qX + std::sin(alpha - m_gamma) * qY); + double prefactor = 1.0 / M_TWOPI; + qa = a * prefactor * (std::cos(m_gamma) * qX - std::sin(m_gamma) * qY); + qb = b * prefactor * (std::cos(alpha - m_gamma) * qX + std::sin(alpha - m_gamma) * qY); } void IFTDecayFunction2D::register_decay_lengths() diff --git a/Core/Aggregate/FTDecayFunctions.h b/Core/Aggregate/FTDecayFunctions.h index abf68ed53f80f7d75c5285c1eb02df88ffa9d5ba..226fb65e00055ca6e26cf1075c010fb807e0a8a1 100644 --- a/Core/Aggregate/FTDecayFunctions.h +++ b/Core/Aggregate/FTDecayFunctions.h @@ -117,9 +117,6 @@ public: //! get angle between first lattice vector and X-axis of distribution (both in direct space) double gamma() const { return m_gamma; } - //! get angle between X- and Y-axis of distribution (in direct space) - double delta() const { return m_delta; } - //! get decay length in distribution's X-direction double decayLengthX() const { return m_decay_length_x; } @@ -140,7 +137,6 @@ protected: double m_decay_length_x; double m_decay_length_y; double m_gamma; - double m_delta; }; diff --git a/Core/Aggregate/InterferenceFunction2DLattice.cpp b/Core/Aggregate/InterferenceFunction2DLattice.cpp index b59af1379452471b63628499a475d289ea9d09b4..eb967dc3ec2a25b258df0629819962dc2294f93f 100644 --- a/Core/Aggregate/InterferenceFunction2DLattice.cpp +++ b/Core/Aggregate/InterferenceFunction2DLattice.cpp @@ -172,16 +172,16 @@ double InterferenceFunction2DLattice::interferenceAtOneRecLatticePoint(double qx " -> Error! No decay function defined."); double qp1, qp2; double gamma = m_decay->gamma(); - double delta = m_decay->delta(); - transformToPrincipalAxes(qx, qy, gamma, delta, qp1, qp2); + transformToPrincipalAxes(qx, qy, gamma, qp1, qp2); return m_decay->evaluate(qp1, qp2); } +// Rotate between orthonormal systems (q_x,q_y) -> (q_X,q_Y) void InterferenceFunction2DLattice::transformToPrincipalAxes( - double qx, double qy, double gamma, double delta, double &q_pa_1, double &q_pa_2) const + double qx, double qy, double gamma, double &q_pa_1, double &q_pa_2) const { q_pa_1 = qx * std::cos(gamma) + qy * std::sin(gamma); - q_pa_2 = qx * std::cos(gamma + delta) + qy * std::sin(gamma + delta); + q_pa_2 = -qx * std::sin(gamma) + qy * std::cos(gamma); } void InterferenceFunction2DLattice::calculateReciprocalVectorFraction( diff --git a/Core/Aggregate/InterferenceFunction2DLattice.h b/Core/Aggregate/InterferenceFunction2DLattice.h index 46126f735df958f9283537fa098e46c292418312..74183727585c165c697bd7f6137b50d721f3f56f 100644 --- a/Core/Aggregate/InterferenceFunction2DLattice.h +++ b/Core/Aggregate/InterferenceFunction2DLattice.h @@ -66,7 +66,7 @@ private: //! Returns reciprocal coordinates in the principal axis system void transformToPrincipalAxes(double qx, double qy, double gamma, - double delta, double& q_pa_1, double& q_pa_2) const; + double& q_pa_1, double& q_pa_2) const; //! Returns qx,qy coordinates of q - qint, where qint is a reciprocal lattice vector //! bounding the reciprocal unit cell to which q belongs diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py index 0f9e7585e678d8d9643c54b316690449e41b270c..30c4b4286dde69d46f8d68f6f0ab0a11ebfacd4e 100644 --- a/auto/Wrap/libBornAgainCore.py +++ b/auto/Wrap/libBornAgainCore.py @@ -10340,18 +10340,6 @@ class IFTDecayFunction2D(ICloneable, INode): return _libBornAgainCore.IFTDecayFunction2D_gamma(self) - def delta(self): - """ - delta(IFTDecayFunction2D self) -> double - - double IFTDecayFunction2D::delta() const - - get angle between X- and Y-axis of distribution (in direct space) - - """ - return _libBornAgainCore.IFTDecayFunction2D_delta(self) - - def decayLengthX(self): """ decayLengthX(IFTDecayFunction2D self) -> double diff --git a/auto/Wrap/libBornAgainCore_wrap.cpp b/auto/Wrap/libBornAgainCore_wrap.cpp index 9f73b66123caf5ce7637e4e90be6b6e57db80fa0..59145feefb49ff00206f691b852821d54869a220 100644 --- a/auto/Wrap/libBornAgainCore_wrap.cpp +++ b/auto/Wrap/libBornAgainCore_wrap.cpp @@ -66393,28 +66393,6 @@ fail: } -SWIGINTERN PyObject *_wrap_IFTDecayFunction2D_delta(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - IFTDecayFunction2D *arg1 = (IFTDecayFunction2D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:IFTDecayFunction2D_delta",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_IFTDecayFunction2D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IFTDecayFunction2D_delta" "', argument " "1"" of type '" "IFTDecayFunction2D const *""'"); - } - arg1 = reinterpret_cast< IFTDecayFunction2D * >(argp1); - result = (double)((IFTDecayFunction2D const *)arg1)->delta(); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_IFTDecayFunction2D_decayLengthX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IFTDecayFunction2D *arg1 = (IFTDecayFunction2D *) 0 ; @@ -128409,14 +128387,6 @@ static PyMethodDef SwigMethods[] = { "get angle between first lattice vector and X-axis of distribution (both in direct space) \n" "\n" ""}, - { (char *)"IFTDecayFunction2D_delta", _wrap_IFTDecayFunction2D_delta, METH_VARARGS, (char *)"\n" - "IFTDecayFunction2D_delta(IFTDecayFunction2D self) -> double\n" - "\n" - "double IFTDecayFunction2D::delta() const\n" - "\n" - "get angle between X- and Y-axis of distribution (in direct space) \n" - "\n" - ""}, { (char *)"IFTDecayFunction2D_decayLengthX", _wrap_IFTDecayFunction2D_decayLengthX, METH_VARARGS, (char *)"\n" "IFTDecayFunction2D_decayLengthX(IFTDecayFunction2D self) -> double\n" "\n"