Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef ApproxMVBB_AngleFunctions_hpp
00011 #define ApproxMVBB_AngleFunctions_hpp
00012
00013 #include <cmath>
00014 #include "ApproxMVBB/Config/Config.hpp"
00015 #include ApproxMVBB_TypeDefs_INCLUDE_FILE
00016 namespace ApproxMVBB{
00017 namespace AngleFunctions {
00018
00019 ApproxMVBB_DEFINE_MATRIX_TYPES
00020
00024 inline PREC mapToPi(PREC x) {
00025 return x - std::floor( x/(2.0*M_PI) + 0.5 ) * M_PI * 2.0;
00026 }
00027
00031 inline PREC mapTo2Pi(PREC x) {
00032 return x - std::floor( x/(2.0*M_PI)) * M_PI * 2.0;
00033 }
00034
00036 inline PREC relativeAnglePi(PREC angle, PREC angle2) {
00037 return mapToPi(angle2-angle);
00038 }
00040 inline PREC relativeAngle2Pi(PREC angle, PREC angle2) {
00041 return mapTo2Pi(angle2-angle);
00042 }
00043
00044 }
00045 }
00046 #endif // AngleFunctions_hpp
00047
00048