00001
00002
00003
00004
00005
00006
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 }
00036
00037
00038 #endif