Main MRPT website > C++ reference for MRPT 1.5.7
xsmath.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 #ifndef XSMATH_H
10 #define XSMATH_H
11 
12 #include "xstypesconfig.h"
13 #include "xstypedefs.h"
14 #include "pstdint.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 XSTYPES_DLL_API extern const XsReal XsMath_e;
21 XSTYPES_DLL_API extern const XsReal XsMath_pi;
32 XSTYPES_DLL_API extern const XsReal XsMath_pt5;
34 XSTYPES_DLL_API extern const XsReal XsMath_one;
36 XSTYPES_DLL_API extern const XsReal XsMath_two;
43 
51 #ifndef XSENS_NO_INT64
53 #endif
54 
55 #ifdef __cplusplus
56 } // extern "C"
57 
58 namespace XsMath {
59  //! \brief The value e
60  static const XsReal& e = XsMath_e;
61  //! \brief The value pi
62  static const XsReal& pi = XsMath_pi;
63  //! \brief A really small value
64  static const XsReal& tinyValue = XsMath_tinyValue;
65  //! \brief A convincingly large number
66  static const XsReal& hugeValue = XsMath_hugeValue;
67  //! \brief A value related to the precision of floating point arithmetic (2.2204460492503131e-016)
68  static const XsReal& epsilon = XsMath_epsilon;
69  /*! \brief Square root of epsilon
70  \sa epsilon
71  */
72  static const XsReal& sqrtEpsilon = XsMath_sqrtEpsilon;
73  //! \brief Value that represents the subnormal number in floating point wizardry
74  static const XsReal& denormalized = XsMath_denormalized;
75  /*! \brief Square root of denormalized
76  \sa denormalized
77  */
78  static const XsReal& sqrtDenormalized = XsMath_sqrtDenormalized;
79  //! \brief Value to convert radians to degrees by multiplication
80  static const XsReal& rad2degValue = XsMath_rad2degValue;
81  //! \brief Value to convert degrees to radians by multiplication
82  static const XsReal& deg2radValue = XsMath_deg2radValue;
83  //! \brief 0
84  static const XsReal& zero = XsMath_zero;
85  //! \brief 0.25
86  static const XsReal& pt25 = XsMath_pt25;
87  //! \brief 0.5
88  static const XsReal& pt5 = XsMath_pt5;
89  //! \brief -0.5
90  static const XsReal& minusPt5 = XsMath_minusPt5;
91  //! \brief 1
92  static const XsReal& one = XsMath_one;
93  //! \brief -1
94  static const XsReal& minusOne = XsMath_minusOne;
95  //! \brief 2
96  static const XsReal& two = XsMath_two;
97  //! \brief 4
98  static const XsReal& four = XsMath_four;
99  //! \brief -2
100  static const XsReal& minusTwo = XsMath_minusTwo;
101  //! \brief -pi/2
102  static const XsReal& minusHalfPi = XsMath_minusHalfPi;
103  //! \brief pi/2
104  static const XsReal& halfPi = XsMath_halfPi;
105  //! \brief sqrt(2)
106  static const XsReal& sqrt2 = XsMath_sqrt2;
107  //! \brief infinity
108  static const XsReal& infinity = XsMath_infinity;
109 
110 
111  //! \brief \copybrief XsMath_asinClamped
112  inline XsReal asinClamped(XsReal x)
113  {
114  return XsMath_asinClamped(x);
115  }
116  //! \brief \copybrief XsMath_rad2deg
117  inline XsReal rad2deg(XsReal radians)
118  {
119  return XsMath_rad2deg(radians);
120  }
121  //! \brief \copybrief XsMath_deg2rad
122  inline XsReal deg2rad(XsReal degrees)
123  {
124  return XsMath_deg2rad(degrees);
125  }
126  //! \brief \copybrief XsMath_pow2
127  inline XsReal pow2(XsReal a)
128  {
129  return XsMath_pow2(a);
130  }
131  //! \brief \copybrief XsMath_pow3
132  inline XsReal pow3(XsReal a)
133  {
134  return XsMath_pow3(a);
135  }
136  //! \brief \copybrief XsMath_doubleToLong
137  inline int32_t doubleToLong(double d)
138  {
139  return XsMath_doubleToLong(d);
140  }
141 #ifndef XSENS_NO_INT64
142  //! \brief \copybrief XsMath_doubleToInt64
143  inline int64_t doubleToInt64(double d)
144  {
145  return XsMath_doubleToInt64(d);
146  }
147 #endif
148 } // namespace
149 #endif
150 
151 #endif // file guard
XSTYPES_DLL_API XsReal XsMath_pow3(XsReal a)
XSTYPES_DLL_API XsReal XsMath_deg2rad(XsReal degrees)
XSTYPES_DLL_API const XsReal XsMath_denormalized
XSTYPES_DLL_API const XsReal XsMath_infinity
XSTYPES_DLL_API const XsReal XsMath_zero
XSTYPES_DLL_API const XsReal XsMath_one
XSTYPES_DLL_API XsReal XsMath_rad2deg(XsReal radians)
XSTYPES_DLL_API const XsReal XsMath_tinyValue
XSTYPES_DLL_API const XsReal XsMath_pt25
XSTYPES_DLL_API const XsReal XsMath_pi
XSTYPES_DLL_API const XsReal XsMath_sqrt2
XSTYPES_DLL_API const XsReal XsMath_two
XSTYPES_DLL_API const XsReal XsMath_minusPt5
XSTYPES_DLL_API const XsReal XsMath_rad2degValue
XSTYPES_DLL_API const XsReal XsMath_deg2radValue
XSTYPES_DLL_API const XsReal XsMath_minusOne
XSTYPES_DLL_API const XsReal XsMath_four
__int64 int64_t
Definition: rptypes.h:51
XSTYPES_DLL_API const XsReal XsMath_sqrtEpsilon
XSTYPES_DLL_API const XsReal XsMath_e
XSTYPES_DLL_API int XsMath_isFinite(XsReal x)
XSTYPES_DLL_API const XsReal XsMath_minusHalfPi
#define XSTYPES_DLL_API
Definition: xstypesconfig.h:9
__int32 int32_t
Definition: rptypes.h:48
XSTYPES_DLL_API XsReal XsMath_pow2(XsReal a)
XSTYPES_DLL_API int32_t XsMath_doubleToLong(double d)
double XsReal
Defines the floating point type used by the Xsens libraries.
Definition: xstypedefs.h:16
XSTYPES_DLL_API const XsReal XsMath_halfPi
XSTYPES_DLL_API const XsReal XsMath_minusTwo
XSTYPES_DLL_API const XsReal XsMath_epsilon
XSTYPES_DLL_API int64_t XsMath_doubleToInt64(double d)
XSTYPES_DLL_API const XsReal XsMath_pt5
GLenum GLint x
Definition: glext.h:3516
GLubyte GLubyte GLubyte a
Definition: glext.h:5575
XSTYPES_DLL_API const XsReal XsMath_hugeValue
XSTYPES_DLL_API const XsReal XsMath_sqrtDenormalized
XSTYPES_DLL_API XsReal XsMath_asinClamped(XsReal x)



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019