MRPT  1.9.9
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-2018, 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 {
60 //! \brief The value e
61 static const XsReal& e = XsMath_e;
62 //! \brief The value pi
63 static const XsReal& pi = XsMath_pi;
64 //! \brief A really small value
65 static const XsReal& tinyValue = XsMath_tinyValue;
66 //! \brief A convincingly large number
67 static const XsReal& hugeValue = XsMath_hugeValue;
68 //! \brief A value related to the precision of floating point arithmetic
69 //! (2.2204460492503131e-016)
70 static const XsReal& epsilon = XsMath_epsilon;
71 /*! \brief Square root of epsilon
72  \sa epsilon
73 */
74 static const XsReal& sqrtEpsilon = XsMath_sqrtEpsilon;
75 //! \brief Value that represents the subnormal number in floating point wizardry
76 static const XsReal& denormalized = XsMath_denormalized;
77 /*! \brief Square root of denormalized
78  \sa denormalized
79 */
80 static const XsReal& sqrtDenormalized = XsMath_sqrtDenormalized;
81 //! \brief Value to convert radians to degrees by multiplication
82 static const XsReal& rad2degValue = XsMath_rad2degValue;
83 //! \brief Value to convert degrees to radians by multiplication
84 static const XsReal& deg2radValue = XsMath_deg2radValue;
85 //! \brief 0
86 static const XsReal& zero = XsMath_zero;
87 //! \brief 0.25
88 static const XsReal& pt25 = XsMath_pt25;
89 //! \brief 0.5
90 static const XsReal& pt5 = XsMath_pt5;
91 //! \brief -0.5
92 static const XsReal& minusPt5 = XsMath_minusPt5;
93 //! \brief 1
94 static const XsReal& one = XsMath_one;
95 //! \brief -1
96 static const XsReal& minusOne = XsMath_minusOne;
97 //! \brief 2
98 static const XsReal& two = XsMath_two;
99 //! \brief 4
100 static const XsReal& four = XsMath_four;
101 //! \brief -2
102 static const XsReal& minusTwo = XsMath_minusTwo;
103 //! \brief -pi/2
104 static const XsReal& minusHalfPi = XsMath_minusHalfPi;
105 //! \brief pi/2
106 static const XsReal& halfPi = XsMath_halfPi;
107 //! \brief sqrt(2)
108 static const XsReal& sqrt2 = XsMath_sqrt2;
109 //! \brief infinity
110 static const XsReal& infinity = XsMath_infinity;
111 
112 //! \brief \copybrief XsMath_asinClamped
113 inline XsReal asinClamped(XsReal x) { return XsMath_asinClamped(x); }
114 //! \brief \copybrief XsMath_rad2deg
115 inline XsReal rad2deg(XsReal radians) { return XsMath_rad2deg(radians); }
116 //! \brief \copybrief XsMath_deg2rad
117 inline XsReal deg2rad(XsReal degrees) { return XsMath_deg2rad(degrees); }
118 //! \brief \copybrief XsMath_pow2
119 inline XsReal pow2(XsReal a) { return XsMath_pow2(a); }
120 //! \brief \copybrief XsMath_pow3
121 inline XsReal pow3(XsReal a) { return XsMath_pow3(a); }
122 //! \brief \copybrief XsMath_doubleToLong
123 inline int32_t doubleToLong(double d) { return XsMath_doubleToLong(d); }
124 #ifndef XSENS_NO_INT64
125 //! \brief \copybrief XsMath_doubleToInt64
126 inline int64_t doubleToInt64(double d) { return XsMath_doubleToInt64(d); }
127 #endif
128 } // namespace
129 #endif
130 
131 #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:49
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:46
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:3538
GLubyte GLubyte GLubyte a
Definition: glext.h:6279
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: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020