BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
FrameUtil.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Base/Axis/FrameUtil.h
6 //! @brief Defines namespace DataUtils.
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_AXIS_FRAMEUTIL_H
16 #define BORNAGAIN_BASE_AXIS_FRAMEUTIL_H
17 
18 class Frame;
19 class IAxis;
20 
21 namespace FramUtil {
22 
23 //! Transforms coordinate on axis into the bin-fraction-coordinate.
24 double coordinateToBinf(double coordinate, const IAxis& axis);
25 
26 //! Transforms bin-fraction-coordinate into axis coordinate.
27 double coordinateFromBinf(double value, const IAxis& axis);
28 
29 //! Transforms x,y coordinate from Datafield axes coordinates to bin-fraction-coordinates.
30 void coordinatesToBinf(double& x, double& y, const Frame& frame);
31 
32 //! Transforms x,y coordinate from bin-fraction-coordinates to Datafield's axes coordinates.
33 void coordinatesFromBinf(double& x, double& y, const Frame& frame);
34 
35 } // namespace FramUtil
36 
37 #endif // BORNAGAIN_BASE_AXIS_FRAMEUTIL_H
Holds one or two axes.
Definition: Frame.h:27
Abstract base class for one-dimensional axes.
Definition: IAxis.h:27
void coordinatesToBinf(double &x, double &y, const Frame &frame)
Transforms x,y coordinate from Datafield axes coordinates to bin-fraction-coordinates.
Definition: FrameUtil.cpp:53
void coordinatesFromBinf(double &x, double &y, const Frame &frame)
Transforms x,y coordinate from bin-fraction-coordinates to Datafield's axes coordinates.
Definition: FrameUtil.cpp:59
double coordinateToBinf(double coordinate, const IAxis &axis)
Transforms coordinate on axis into the bin-fraction-coordinate.
Definition: FrameUtil.cpp:26
double coordinateFromBinf(double value, const IAxis &axis)
Transforms bin-fraction-coordinate into axis coordinate.
Definition: FrameUtil.cpp:34