Main Page | File List

xmath.h

Go to the documentation of this file.
00001 /**
00002  *\file         xmath.h
00003  *
00004  *\brief        some commonly used math routines.
00005  *
00006  *\author       Xianming Chen
00007  */
00008 
00009 
00010 #ifndef _XMATH_H
00011 #define _XMATH_H
00012 
00013 
00014 
00015 namespace columbia
00016 {
00017   const double pi = 3.1416;
00018   
00019 
00020   template<typename T>
00021   T interpolate(double t, T const& P1, T const& P2)
00022   {
00023     return P1*(1-t) + P2*t;
00024   }
00025 
00026   inline int round(double a)
00027   {
00028     if(a>=0) 
00029       return int(a + .49999);
00030     else
00031       return int(a - .49999);
00032   }
00033   
00034 
00035 }//end namespace columbia
00036 
00037 
00038 #endif

Generated on Fri Jul 9 11:02:31 2004 by doxygen 1.3.6