FloatUtils.h

Go to the documentation of this file.
00001 #ifndef FLOATUTILS_H_
00002 #define FLOATUTILS_H_
00003 
00004 #define _USE_MATH_DEFINES
00005 #include <math.h>
00006 
00007 template<typename Type>
00008 inline Type degToRad(Type x) {
00009         return (x * M_PI) / 180.0;
00010 }
00011 
00012 template<typename Type>
00013 inline Type radToDeg(Type x) {
00014         return (x * 180.0) / M_PI;
00015 }
00016 
00020 template<typename Type>
00021 inline bool floatEq(Type x, Type v, float EPSILON = 0.0005f) {
00022         return ((v - EPSILON) < x) && (x < (v + EPSILON));
00023 }
00024 
00025 #endif

Generated on Mon Jan 23 19:44:27 2006 for Visualization by  doxygen 1.4.6