18 #ifndef MATHSUP_INCLUDEDEFX_H 19 #define MATHSUP_INCLUDEDEFX_H 34 static const double PI;
48 return (dAngRad * 180.0 / PI);
56 return ( dAngDeg * PI / 180.0 );
64 angle-=floor(angle/(2 * PI))* 2 *
PI;
73 if ( angle> PI ) angle-=2 *
PI;
82 if (angle > PI) angle-=2*
PI;
83 if (angle > PI/2.0) angle -=
PI;
84 if (angle <= -PI/2.0) angle +=
PI;
90 static double sign(
const double& x)
101 static double getMin(
const double& a,
const double& b)
112 static double getMax(
const double& a,
const double& b)
139 if((x==0.0) && (y==0.0))
141 else if((x==0.0) && (y > 0.0))
143 else if((x==0.0) && (y < 0.0))
145 else if((y==0.0) && (x > 0.0))
147 else if((y==0.0) && (x < 0.0))
168 static double distance(
double x1,
double y1,
double x2,
double y2)
176 static double distanceSq(
double x1,
double y1,
double x2,
double y2)
181 return dx*dx + dy*dy;
189 if( (iVal & (1 << iNrBit)) == 0)
222 if( (c[0] & 0x80) == 0)
227 dFraction = (iVal & 0xFFFFFF) | 0x800000;
228 dFraction = dFraction * pow(2., -23);
230 dExp = ((c[0] << 1) | (c[1] >> 7)) - 127;
232 dVal = dSign * dFraction * pow(10., dExp);
244 static int limit(
double* pdToLimit,
double dLimit)
248 if(*pdToLimit < -dLimit)
250 *pdToLimit = -dLimit;
253 if(*pdToLimit > dLimit)
269 static int limit(
int* piToLimit,
int iLimit)
273 if(*piToLimit < -iLimit)
275 *piToLimit = -iLimit;
278 if(*piToLimit > iLimit)
296 if( (dVal >= dLow) && (dVal <= dHigh) )
static int limit(double *pdToLimit, double dLimit)
static const double HALF_PI
Constant for PI/2.
static double convRadToDeg(const double &dAngRad)
static double atan4quad(double y, double x)
static double sign(const double &x)
static void normalize2Pi(double &angle)
static const double PI
Constant for PI.
static double calcDeltaAng(const double &a, const double &b)
static int limit(int *piToLimit, int iLimit)
static double getMin(const double &a, const double &b)
static void normalizePi(double &angle)
static double distanceSq(double x1, double y1, double x2, double y2)
static double distance(double x1, double y1, double x2, double y2)
static bool isInInterval(double dLow, double dHigh, double dVal)
static bool isBitSet(int iVal, int iNrBit)
static double convDegToRad(const double &dAngDeg)
static double getMax(const double &a, const double &b)
static double convInt4ByteToFloat(int iVal)
static double convFloatToInt4Byte(double dVal)
static void normalizePiHalf(double &angle)
static const double TWO_PI
Constant for 2*PI.