MRPT  1.9.9
xsmath.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef XSMATH_H
10 #define XSMATH_H
11 
12 #include "pstdint.h"
13 #include "xstypedefs.h"
14 #include "xstypesconfig.h"
15 
16 #ifdef __cplusplus
17 extern "C"
18 {
19 #endif
20 
21  XSTYPES_DLL_API extern const XsReal XsMath_e;
22  XSTYPES_DLL_API extern const XsReal XsMath_pi;
31  XSTYPES_DLL_API extern const XsReal XsMath_zero;
32  XSTYPES_DLL_API extern const XsReal XsMath_pt25;
33  XSTYPES_DLL_API extern const XsReal XsMath_pt5;
35  XSTYPES_DLL_API extern const XsReal XsMath_one;
37  XSTYPES_DLL_API extern const XsReal XsMath_two;
38  XSTYPES_DLL_API extern const XsReal XsMath_four;
42  XSTYPES_DLL_API extern const XsReal XsMath_sqrt2;
44 
52 #ifndef XSENS_NO_INT64
54 #endif
55 
56 #ifdef __cplusplus
57 } // extern "C"
58 
59 namespace XsMath
60 {
61 //! \brief The value e
62 static const XsReal& e = XsMath_e;
63 //! \brief The value pi
64 static const XsReal& pi = XsMath_pi;
65 //! \brief A really small value
66 static const XsReal& tinyValue = XsMath_tinyValue;
67 //! \brief A convincingly large number
68 static const XsReal& hugeValue = XsMath_hugeValue;
69 //! \brief A value related to the precision of floating point arithmetic
70 //! (2.2204460492503131e-016)
71 static const XsReal& epsilon = XsMath_epsilon;
72 /*! \brief Square root of epsilon
73  \sa epsilon
74 */
75 static const XsReal& sqrtEpsilon = XsMath_sqrtEpsilon;
76 //! \brief Value that represents the subnormal number in floating point wizardry
77 static const XsReal& denormalized = XsMath_denormalized;
78 /*! \brief Square root of denormalized
79  \sa denormalized
80 */
81 static const XsReal& sqrtDenormalized = XsMath_sqrtDenormalized;
82 //! \brief Value to convert radians to degrees by multiplication
83 static const XsReal& rad2degValue = XsMath_rad2degValue;
84 //! \brief Value to convert degrees to radians by multiplication
85 static const XsReal& deg2radValue = XsMath_deg2radValue;
86 //! \brief 0
87 static const XsReal& zero = XsMath_zero;
88 //! \brief 0.25
89 static const XsReal& pt25 = XsMath_pt25;
90 //! \brief 0.5
91 static const XsReal& pt5 = XsMath_pt5;
92 //! \brief -0.5
93 static const XsReal& minusPt5 = XsMath_minusPt5;
94 //! \brief 1
95 static const XsReal& one = XsMath_one;
96 //! \brief -1
97 static const XsReal& minusOne = XsMath_minusOne;
98 //! \brief 2
99 static const XsReal& two = XsMath_two;
100 //! \brief 4
101 static const XsReal& four = XsMath_four;
102 //! \brief -2
103 static const XsReal& minusTwo = XsMath_minusTwo;
104 //! \brief -pi/2
105 static const XsReal& minusHalfPi = XsMath_minusHalfPi;
106 //! \brief pi/2
107 static const XsReal& halfPi = XsMath_halfPi;
108 //! \brief sqrt(2)
109 static const XsReal& sqrt2 = XsMath_sqrt2;
110 //! \brief infinity
111 static const XsReal& infinity = XsMath_infinity;
112 
113 //! \brief \copybrief XsMath_asinClamped
114 inline XsReal asinClamped(XsReal x) { return XsMath_asinClamped(x); }
115 //! \brief \copybrief XsMath_rad2deg
116 inline XsReal rad2deg(XsReal radians) { return XsMath_rad2deg(radians); }
117 //! \brief \copybrief XsMath_deg2rad
118 inline XsReal deg2rad(XsReal degrees) { return XsMath_deg2rad(degrees); }
119 //! \brief \copybrief XsMath_pow2
120 inline XsReal pow2(XsReal a) { return XsMath_pow2(a); }
121 //! \brief \copybrief XsMath_pow3
122 inline XsReal pow3(XsReal a) { return XsMath_pow3(a); }
123 //! \brief \copybrief XsMath_doubleToLong
124 inline int32_t doubleToLong(double d) { return XsMath_doubleToLong(d); }
125 #ifndef XSENS_NO_INT64
126 //! \brief \copybrief XsMath_doubleToInt64
127 inline int64_t doubleToInt64(double d) { return XsMath_doubleToInt64(d); }
128 #endif
129 } // namespace XsMath
130 #endif
131 
132 #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:52
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:49
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:17
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:3542
GLubyte GLubyte GLubyte a
Definition: glext.h:6372
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.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019