AngleFunctions.hpp
Go to the documentation of this file.
00001 // ========================================================================================
00002 //  ApproxMVBB
00003 //  Copyright (C) 2014 by Gabriel Nützi <nuetzig (at) imes (d0t) mavt (d0t) ethz (døt) ch>
00004 //
00005 //  This Source Code Form is subject to the terms of the Mozilla Public
00006 //  License, v. 2.0. If a copy of the MPL was not distributed with this
00007 //  file, You can obtain one at http://mozilla.org/MPL/2.0/.
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 


asr_approx_mvbb
Author(s): Gassner Nikolai
autogenerated on Sat Jun 8 2019 20:21:49