2 Copyright 2006 Johnathan Corgan.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License version 2
6 as published by the Free Software Foundation.
8 This software is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with GNU Radio; see the file COPYING. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street,
16 Boston, MA 02110-1301, USA.
22 // System level includes
25 inline double limit(double x, double lower, double upper)
35 inline int limit(int x, int lower, int upper)
45 inline double degree_normalize(double degrees)
48 return degrees - 360.0;
49 else if (degrees < 0.0)
50 return degrees + 360.0;
55 inline int degree_normalize(int degrees)
65 inline double to_radians(double degrees)
67 return degrees/180.0*M_PI;
70 inline double to_degrees(double radians)
72 return radians/M_PI*180.0;
75 #define LOGFUNCTION wxLogDebug("%s", __PRETTY_FUNCTION__)
76 #define LOGFUNCTIONENTRY wxLogDebug("%s: entered", __PRETTY_FUNCTION__)
77 #define LOGFUNCTIONEXIT wxLogDebug("%s: exited", __PRETTY_FUNCTION__)