00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __rdMtx_h__
00010 #define __rdMtx_h__
00011
00012
00013
00014 #include "rdTools.h"
00015
00016
00017
00018
00023 class RDTOOLS_API rdMtx
00024 {
00025
00026
00027
00028 private:
00029 static int _PSpaceSize;
00030 static int _WSpaceSize;
00031 static double **_P1Space;
00032 static double **_P2Space;
00033 static double *_WSpace;
00034
00035
00036
00037
00038 public:
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 static double Angle(const double *aV1,const double *aV2);
00049 static double Normalize(int aN,const double aV[],double rV[]);
00050 static double Magnitude(int aN,const double aV[]);
00051 static double DotProduct(int aN,const double aV1[],const double aV2[]);
00052 static int CrossProduct(double *aV1,double *aV2,double *aV);
00053 static void
00054 Interpolate(int aN,double aT1,double *aY1,double aT2,double *aY2,
00055 double t,double *aY);
00056 static double
00057 Interpolate(double aT1,double aY1,double aT2,double aY2,
00058 double t);
00059
00060
00061
00062
00063 static void
00064 Translate(double aX,double aY,double aZ,const double aP[3],double rP[3]);
00065 static void
00066 Rotate(int aXYZ,double aRadians,const double aP[3],double rP[3]);
00067 static void
00068 Rotate(const double aAxis[3],double aRadians,const double aP[3],
00069 double rP[3]);
00070 static void
00071 RotateDeg(int aXYZ,double aDegrees,const double aP[3],double rP[3]);
00072 static void
00073 RotateDeg(const double aAxis[3],double aDegrees,const double aP[3],
00074 double rP[3]);
00075
00076
00077
00078
00079 static int Identity(int aNR,double *rI);
00080 static int Assign(int aNR,int aNC,double aScalar,double *rM);
00081 static int Assign(int aNR,int aNC,const double *aM,double *rM);
00082 static int Add(int aNR,int aNC,const double *aM1,double aScalar,double *aM);
00083 static int Add(int aNR,int aNC,const double *aM1,const double *aM2,double *aM);
00084 static int Subtract(int aNR,int aNC,const double *aM1,const double *aM2,
00085 double *aM);
00086 static int Multiply(int aNR,int aNC,const double *aM,double aScalar,double *rM);
00087 static int Multiply(int aNR1,int aNCR,int aNC2,const double *aM1,
00088 const double *aM2,double *aM);
00089 static int Invert(int aN,const double *aM,double *aMInv);
00090 static int Transpose(int aNR,int aNC,const double *aM,double *aMT);
00091 static void Print(int aNR,int aNC,const double *aM,int aPrecision=8);
00092
00093
00094
00095
00096 static int FindIndex(int aStartIndex,double aTime,int aNT,double *aT);
00097 static int FindIndexLess(int aNX,double *aX,double aValue);
00098 static int FindIndexGreater(int aNX,double *aX,double aValue);
00099 static int ComputeIndex(int i2,int n1,int i1);
00100 static int ComputeIndex(int i3,int n2,int i2,int n1,int i1);
00101 static void GetDim3(int n3,int n2,int n1,int i2,int i1,double *m,double *a);
00102 static void SetDim3(int n3,int n2,int n1,int i2,int i1,double *m,double *a);
00103
00104
00105
00106
00107 static int EnsureWorkSpaceCapacity(int aN);
00108 static int EnsurePointerSpaceCapacity(int aN);
00109 static void FreeWorkAndPointerSpaces();
00110
00111
00112 };
00113
00114
00115
00116 #endif // __rdMtx_h__