BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
WavevectorInfo.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Base/Vector/WavevectorInfo.cpp
6 //! @brief Implements WavevectorInfo.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
16 #include "Base/Vector/RotMatrix.h"
17 
18 WavevectorInfo::WavevectorInfo(C3 ki, C3 kf, double wavelength)
19  : m_ki(ki)
20  , m_kf(kf)
21  , m_vacuum_wavelength(wavelength)
22 {
23 }
24 
25 WavevectorInfo::WavevectorInfo(R3 ki, R3 kf, double wavelength)
26  : WavevectorInfo(ki.complex(), kf.complex(), wavelength)
27 {
28 }
29 
30 // TODO: can be removed when IReParticle::volume() is refactored
31 // (static function is provided to easily track usage of default constructor)
33 {
34  return {R3{1, 0, 0}, R3{1, 0, 0}, 1.0};
35 }
36 
38 {
39  return WavevectorInfo(transform.transformed(m_ki), transform.transformed(m_kf),
41 }
Declares class RotMatrix.
Defines WavevectorInfo.
Rotation matrix in three dimensions. Represents group SO(3). Internal parameterization based on quate...
Definition: RotMatrix.h:25
T transformed(const T &v) const
Return transformed vector v.
Definition: RotMatrix.cpp:76
Holds all wavevector information relevant for calculating form factors.
double m_vacuum_wavelength
WavevectorInfo(C3 ki, C3 kf, double wavelength)
static WavevectorInfo makeZeroQ()
WavevectorInfo transformed(const RotMatrix &transform) const