Electronic fence.
[sdlbotor.git] / globalfunc.cpp
blob42d83b4fee346fb7f11a86376c65a458358c8b7d
1 #include <cmath>
2 #include "globalfunc.h"
4 namespace botor
7 // template<typename T>
8 // int sign( T a )
9 // {
10 // return (a == 0) ? 0 : ( (a<0) ? -1 : 1 );
11 // }
13 double dst( float x1, float y1, float x2, float y2 )
15 return sqrt( pow( y2-y1, 2 ) + pow( x2-x1, 2 ) );
18 bool isBitSet( unsigned int mask, unsigned int bit )
20 return (mask & bit) == bit;