Go to the documentation of this file.
9 #ifndef MRPT_MATH_WRAP2PI_H
10 #define MRPT_MATH_WRAP2PI_H
31 a = fmod(
a,
static_cast<T
>(2.0 *
M_PI));
32 if (was_neg)
a +=
static_cast<T
>(2.0 *
M_PI);
73 template <
class VECTOR>
76 const size_t N =
x.size();
77 for (
size_t i = 0; i < N; i++)
81 double Ap =
x[i] -
x[i - 1];
T angDistance(T from, T to)
Computes the shortest angular increment (or distance) between two planar orientations,...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
T wrapTo2Pi(T a)
Modifies the given angle to translate it into the [0,2pi[ range.
void wrapToPiInPlace(T &a)
Modifies the given angle to translate it into the ]-pi,pi] range.
T wrapToPi(T a)
Modifies the given angle to translate it into the ]-pi,pi] range.
void wrapTo2PiInPlace(T &a)
Modifies the given angle to translate it into the [0,2pi[ range.
void unwrap2PiSequence(VECTOR &x)
Modify a sequence of angle values such as no consecutive values have a jump larger than PI in absolut...
GLubyte GLubyte GLubyte a
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at mié 12 jul 2023 10:03:34 CEST | |