Template Function mrpt::math::angDistance
Defined in File wrap2pi.h
Function Documentation
-
template<class T>
T mrpt::math::angDistance(T from, T to) Computes the shortest angular increment (or distance) between two planar orientations, such that it is constrained to [-pi,pi] and is correct for any combination of angles (e.g. near +-pi) Examples: angDistance(0,pi) -> +pi; angDistance(pi,0) -> -pi; angDistance(-3.1,3.1) -> -0.08; angDistance(3.1,-3.1) -> +0.08;
Note
Take care of not instancing this template for integer numbers, since it only works for float, double and long double.