xsmath2.h
Go to the documentation of this file.
1 
2 // Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification,
6 // are permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice,
9 // this list of conditions, and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice,
12 // this list of conditions, and the following disclaimer in the documentation
13 // and/or other materials provided with the distribution.
14 //
15 // 3. Neither the names of the copyright holders nor the names of their contributors
16 // may be used to endorse or promote products derived from this software without
17 // specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
24 // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
26 // TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS
28 // SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES
29 // OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE
30 // ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES.
31 //
32 
33 
34 // Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
35 // All rights reserved.
36 //
37 // Redistribution and use in source and binary forms, with or without modification,
38 // are permitted provided that the following conditions are met:
39 //
40 // 1. Redistributions of source code must retain the above copyright notice,
41 // this list of conditions, and the following disclaimer.
42 //
43 // 2. Redistributions in binary form must reproduce the above copyright notice,
44 // this list of conditions, and the following disclaimer in the documentation
45 // and/or other materials provided with the distribution.
46 //
47 // 3. Neither the names of the copyright holders nor the names of their contributors
48 // may be used to endorse or promote products derived from this software without
49 // specific prior written permission.
50 //
51 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
52 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
53 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
54 // THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 // SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
56 // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
58 // TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
59 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS
60 // SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES
61 // OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE
62 // ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES.
63 //
64 
65 #ifndef XSMATH2_H
66 #define XSMATH2_H
67 
68 #ifndef XSMATH_H
69  #include "xsmath.h"
70 #endif
71 
72 #ifdef __cplusplus
73 namespace XsMath
74 {
75 #ifdef __GNUC__
76  #pragma GCC diagnostic push
77  #pragma GCC diagnostic ignored "-Wunused-variable"
78 #endif
98 XSMATHCONST XsReal sqrtDenormalized = XsMath_sqrtDenormalized;
100 XSMATHCONST XsReal rad2degValue = XsMath_rad2degValue;
102 XSMATHCONST XsReal deg2radValue = XsMath_deg2radValue;
133 #ifdef __GNUC__
134  #pragma GCC diagnostic pop
135 #endif
136 
138 XSMATHINLINE XsReal asinClamped(XsReal x)
139 {
140  return XsMath_asinClamped(x);
141 }
142 
144 XSMATHINLINE XsReal rad2deg(XsReal radians)
145 {
146  return XsMath_rad2deg(radians);
147 }
148 
150 XSMATHINLINE XsReal deg2rad(XsReal degrees)
151 {
152  return XsMath_deg2rad(degrees);
153 }
154 
156 XSMATHINLINE XsReal pow2(XsReal a)
157 {
158  return XsMath_pow2(a);
159 }
160 
162 XSMATHINLINE XsReal pow3(XsReal a)
163 {
164  return XsMath_pow3(a);
165 }
166 
168 XSMATHINLINE2 int32_t doubleToLong(double d)
169 {
170  return XsMath_doubleToLong(d);
171 }
172 
173 #ifndef XSENS_NO_INT64
174 XSMATHINLINE2 int64_t doubleToInt64(double d)
176 {
177  return XsMath_doubleToInt64(d);
178 }
179 #endif
180 } // namespace
181 #endif
182 
183 #endif
XsMath_pi
XSMATHCONST XsReal XsMath_pi
The value pi.
Definition: xsmath.h:118
XsMath_asinClamped
XSMATHINLINE XsReal XsMath_asinClamped(const XsReal x)
Returns asin(x) for -1 < x < 1.
Definition: xsmath.h:189
XsMath_twoPi
XSMATHCONST XsReal XsMath_twoPi
2*pi
Definition: xsmath.h:173
epsilon
double epsilon
XsMath_one
XSMATHCONST XsReal XsMath_one
1.0
Definition: xsmath.h:158
XsMath_sqrtEpsilon
XSMATHCONST XsReal XsMath_sqrtEpsilon
Square root of XsMath_epsilon.
Definition: xsmath.h:137
XsMath_sqrtDenormalized
XSMATHCONST XsReal XsMath_sqrtDenormalized
Square root of XsMath_denormalized.
Definition: xsmath.h:141
XsMath_doubleToInt64
XSMATHINLINE2 int64_t XsMath_doubleToInt64(double d)
Returns d integer converted from a double precision floating point value.
Definition: xsmath.h:293
XsMath_minusPt5
XSMATHCONST XsReal XsMath_minusPt5
-0.5
Definition: xsmath.h:156
XsMath_minusTwo
XSMATHCONST XsReal XsMath_minusTwo
-2
Definition: xsmath.h:166
XsMath_sqrt2
XSMATHCONST XsReal XsMath_sqrt2
sqrt(2)
Definition: xsmath.h:175
XsMath_tinyValue
XSMATHCONST XsReal XsMath_tinyValue
A really small value.
Definition: xsmath.h:120
XSMATHINLINE
#define XSMATHINLINE
Definition: xsmath.h:102
XsMath_pow3
XSMATHINLINE XsReal XsMath_pow3(XsReal a)
Returns a to the power of 3.
Definition: xsmath.h:217
XsMath_minusOne
XSMATHCONST XsReal XsMath_minusOne
-1.0
Definition: xsmath.h:160
XsMath_denormalized
XSMATHCONST XsReal XsMath_denormalized
Value that represents the subnormal number in floating point wizardry.
Definition: xsmath.h:139
XsMath_pt5
XSMATHCONST XsReal XsMath_pt5
0.5
Definition: xsmath.h:154
XSMATHINLINE2
#define XSMATHINLINE2
Definition: xsmath.h:103
XsMath_rad2deg
XSMATHINLINE XsReal XsMath_rad2deg(XsReal radians)
Convert radians to degrees.
Definition: xsmath.h:196
XsReal
double XsReal
Defines the floating point type used by the Xsens libraries.
Definition: xstypedefs.h:73
XsMath_pt25
XSMATHCONST XsReal XsMath_pt25
0.25
Definition: xsmath.h:152
XsMath_infinity
XSMATHCONST XsReal XsMath_infinity
infinity value
Definition: xsmath.h:184
XsMath_doubleToLong
XSMATHINLINE2 int32_t XsMath_doubleToLong(double d)
Returns d integer converted from a double precision floating point value.
Definition: xsmath.h:286
XsMath_e
XSMATHCONST XsReal XsMath_e
The value e.
Definition: xsmath.h:116
xsmath.h
XsMath
Namespace for mathematical constants and operations.
XsMath_two
XSMATHCONST XsReal XsMath_two
2
Definition: xsmath.h:162
XsMath_epsilon
XSMATHCONST XsReal XsMath_epsilon
A value related to the precision of floating point arithmetic (2.2204460492503131e-016)
Definition: xsmath.h:135
XsMath_minusHalfPi
XSMATHCONST XsReal XsMath_minusHalfPi
-pi/2
Definition: xsmath.h:169
XsMath_zero
XSMATHCONST XsReal XsMath_zero
0
Definition: xsmath.h:150
XsMath_pow2
XSMATHINLINE XsReal XsMath_pow2(XsReal a)
Returns a to the power of 2.
Definition: xsmath.h:210
XsMath_sqrtHalf
XSMATHCONST XsReal XsMath_sqrtHalf
sqrt(0.5)
Definition: xsmath.h:177
XsMath_hugeValue
XSMATHCONST XsReal XsMath_hugeValue
A convincingly large number.
Definition: xsmath.h:122
int32_t
signed int int32_t
Definition: pstdint.h:515
XsMath_deg2rad
XSMATHINLINE XsReal XsMath_deg2rad(XsReal degrees)
Convert degrees to radians.
Definition: xsmath.h:203
XsMath_halfPi
XSMATHCONST XsReal XsMath_halfPi
pi/2
Definition: xsmath.h:171
XsMath_rad2degValue
XSMATHCONST XsReal XsMath_rad2degValue
Value to convert radians to degrees by multiplication.
Definition: xsmath.h:145
XsMath_deg2radValue
XSMATHCONST XsReal XsMath_deg2radValue
Value to convert degrees to radians by multiplication.
Definition: xsmath.h:147
XSMATHCONST
#define XSMATHCONST
Definition: xsmath.h:101
XsMath_four
XSMATHCONST XsReal XsMath_four
4
Definition: xsmath.h:164


xsens_mti_driver
Author(s):
autogenerated on Sun Sep 3 2023 02:43:20