00001 // rdMath.h 00002 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00003 // Copyright 2000 Realistic Dynamics, Inc. 00004 // All rights reserved. 00005 // 00006 // Please do not read, copy, distribute, or use without permission. 00007 // Contact: Frank C. Anderson, fca@RealisticDynamics.com 00008 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00009 #ifndef __rdMath_h__ 00010 #define __rdMath_h__ 00011 00012 00013 #include "rdTools.h" 00014 00015 00016 class rdLine; 00017 class rdPlane; 00018 00019 00020 //============================================================================= 00021 //============================================================================= 00025 class RDTOOLS_API rdMath 00026 { 00027 //============================================================================= 00028 // DATA 00029 //============================================================================= 00030 public: 00031 static const double PI; 00032 static const double RTD; 00033 static const double DTR; 00034 static const double SMALL; 00035 static const double ZERO; 00036 static const double NAN; 00037 static const double INFINITY; 00038 static const double MINUS_INFINITY; 00039 static const double PLUS_INFINITY; 00040 00041 //============================================================================= 00042 // METHODS 00043 //============================================================================= 00044 public: 00045 00046 //-------------------------------------------------------------------------- 00047 // ARITHMATIC 00048 //-------------------------------------------------------------------------- 00049 static double CopySign(double aMag,double aSign); 00050 static bool IsZero(double aValue); 00051 00052 //-------------------------------------------------------------------------- 00053 // EXPONENTIAL STEP FUNCTIONS 00054 //-------------------------------------------------------------------------- 00055 static double SigmaUp(double tau,double to,double t); 00056 static double SigmaDn(double tau,double to,double t); 00057 00058 //-------------------------------------------------------------------------- 00059 // CURVE FITTING 00060 //-------------------------------------------------------------------------- 00061 static int 00062 FitParabola(double aX1,double aY1,double aX2,double aY2, 00063 double aX3,double aY3,double *rC0,double *rC1,double *rC2); 00064 00065 //-------------------------------------------------------------------------- 00066 // GEOMETRY 00067 //-------------------------------------------------------------------------- 00068 static int 00069 ComputeIntersection(const rdLine *aLine,const rdPlane *aPlane, 00070 double rPoint[3]); 00071 static void 00072 ComputeNormal(double aP1X,double aP1Y,double aP1Z, 00073 double aP2X,double aP2Y,double aP2Z, 00074 double aP3X,double aP3Y,double aP3Z, 00075 double rNormal[3]); 00076 00077 00078 //============================================================================= 00079 }; // END class rdMath 00080 //============================================================================= 00081 //============================================================================= 00082 00083 #endif // __rdMath_h__ 00084
1.3