Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

Math.h

00001 /*************************************************************************** 00002 * This file is part of OpenCAL: Open Computer Animation Library * 00003 * I created OpenCAL as my master's thesis Computer Science (multimedia) * 00004 * at the tUL university in Diepenbeek, Belgium * 00005 * * 00006 * Copyright (C) 2003-2004 by Jeroen Dierckx * 00007 * jeroen.dierckx@student.luc.ac.be * 00008 * * 00009 ***************************************************************************/ 00010 00011 #ifndef OPENCAL_UTILS_MATH_H 00012 #define OPENCAL_UTILS_MATH_H 00013 00014 // Includes 00015 //#include <OpenCAL/global.h> 00016 00017 namespace OpenCAL 00018 { 00019 namespace Utils 00020 { 00025 class OPENCAL_API Math 00026 { 00027 public: 00028 // Static constants 00029 static const float pi = 3.1415926535898f; 00030 static const float halfPi = 1.5707963267949f; 00031 static const float doublePi = 6.2831853071796f; 00032 00033 static const float verySmall = 0.0000001f; 00034 00035 // Static functions 00036 static float radToDeg(float radians) { return radians * 57.2957795f; } 00037 static float degToRad(float degrees) { return degrees * 0.0174532925f; } 00038 00039 static bool isZero(float number) { return (number == 0.0f); } 00040 static bool isZero(float number, float tolerance) { return (number >= -tolerance && number <= tolerance); } 00041 static bool isBetween(float number, float min, float max) { return (number >= min && number <= max); } 00042 00043 static float squared(float number) { return number * number; } 00044 }; 00045 } 00046 } 00047 00048 #endif // OPENCAL_UTILS_MATH_H

Generated on Sun Aug 15 19:19:22 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8