BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Direction.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Base/Vector/Direction.h
6 //! @brief Defines class Direction.
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 
15 #ifndef BORNAGAIN_BASE_VECTOR_DIRECTION_H
16 #define BORNAGAIN_BASE_VECTOR_DIRECTION_H
17 
18 #include "Base/Vector/Vectors3D.h"
19 
20 kvector_t vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi);
21 
22 //! A direction in three-dimensional space.
23 
24 class Direction {
25 public:
26  Direction(double alpha, double phi) : m_alpha(alpha), m_phi(phi) {}
27  Direction() : Direction(0, 0) {} // needed by Swig
28 
29  double alpha() const { return m_alpha; }
30  double phi() const { return m_phi; }
31 
32  //! Returns Cartesian 3D vector
33  kvector_t vector() const;
34 
35 private:
36  double m_alpha;
37  double m_phi;
38 };
39 
40 #endif // BORNAGAIN_BASE_VECTOR_DIRECTION_H
kvector_t vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi)
Definition: Direction.cpp:19
Defines basic vectors in Z^3, R^3, C^3.
A direction in three-dimensional space.
Definition: Direction.h:24
double phi() const
Definition: Direction.h:30
double alpha() const
Definition: Direction.h:29
Direction()
Definition: Direction.h:27
kvector_t vector() const
Returns Cartesian 3D vector.
Definition: Direction.cpp:24
Direction(double alpha, double phi)
Definition: Direction.h:26
double m_phi
Definition: Direction.h:37
double m_alpha
Definition: Direction.h:36