SIBCMathLib.h

00001 //***************************************************************************************
00002 //
00003 // File supervisor: Crosswalk team
00004 //
00005 // Copyright 2008 Autodesk, Inc.  All rights reserved.  
00006 // Use of this software is subject to the terms of the Autodesk license agreement 
00007 // provided at the time of installation or download, or which otherwise accompanies 
00008 // this software in either electronic or hard copy form.
00009 //
00010 //***************************************************************************************
00011 
00012 #if (_MSC_VER > 1000) || defined(SGI_COMPILER)
00013 #pragma once
00014 #endif
00015 
00016 //******************************************************************************
00017 // Defines
00018 //******************************************************************************
00019 
00020 #ifndef _SIBCMATHLIB_H_
00021 #define _SIBCMATHLIB_H_
00022 
00023 //******************************************************************************
00024 // Includes
00025 //******************************************************************************
00026 #include <math.h>       // for DBL_MAX
00027 #include <float.h>
00028 #include "SIBCUtil.h"
00029 
00030 
00036 typedef enum tagE3DAXISTYPE
00037 {
00038    X_AXIS = 0,  
00039    Y_AXIS = 1,  
00040    Z_AXIS = 2   
00041 } E3DAxisType;
00042 
00045 enum {  
00046     NO_COORD_AXIS   = 0x00,                                         
00047     X_COORD_AXIS    = 0x01,                                         
00048     Y_COORD_AXIS    = 0x02,                                         
00049     Z_COORD_AXIS    = 0x04,                                         
00050     ALL_COORD_AXES  = (X_COORD_AXIS | Y_COORD_AXIS | Z_COORD_AXIS)  
00051 } ;
00052 
00053 typedef double DOUBLE;              
00055 const DOUBLE PICO_EPS   = 1.0e-12;  
00056 const DOUBLE NANO_EPS   = 1.0e-09;  
00057 const DOUBLE HEXA_EPS   = 1.0e-06;  
00058 const DOUBLE MILLI_EPS  = 1.0e-03;  
00059 const DOUBLE SI_HUGE    = DBL_MAX;  
00062 #define M_PI    3.14159265358979323846  // already documented in SIBCMath.h
00063 #define M_E     2.7182818284590452354   // already documented in SIBCMath.h
00064 
00068 #define M_2PI            ( 2 * M_PI )   
00069 #define M_Inv_PI         ( 1.0 / M_PI ) 
00070 #define M_Inv_2PI        ( 0.5 / M_PI ) 
00077 #define DEG_TO_RAD( deg ) ((deg)*M_PI/180.0)
00078 
00084 #define RAD_TO_DEG( rad ) ((rad)*180.0*M_Inv_PI)
00085 
00087 // Old defines from S35MthConsts.h (these are not documented).
00088 #define SI_DEGREES_PER_RAD  (180.0/M_PI)
00089 #define SI_RAD_PER_DEGREES  (M_PI/180.0)
00090 #define _SI_RAD2DEG( x )    ( (x) * SI_DEGREES_PER_RAD )
00091 #define _SI_DEG2RAD( x )    ( (x) * SI_RAD_PER_DEGREES )
00092 
00096 #ifndef NULL
00097 
00098 #define NULL 0  
00099 #endif
00100 
00102 class CSIBCVector2Dd;
00103 class CSIBCVector3Dd;
00104 class CSIBCVector4Dd;
00105 class CSIBCVectorwd;
00106 class CSIBCMatrix33d;
00107 class CSIBCMatrix44d;
00108 class CSIBCMatrixMNd;
00109 class CSIBCRotMatd;
00110 class CSIBCXfoMatd;
00111 class C3DQuat;
00112 class CSIBCRotationd;
00113 class CSIBCTransfod;
00114 
00115 #include "SIBCMatrix33d.h"
00116 #include "SIBCRotMatd.h"
00117 #include "SIBCMatrix44d.h"
00118 #include "SIBCXfoMatd.h"
00119 #include "SIBCVector2Dd.h"
00120 #include "SIBCVector3Dd.h"
00121 #include "SIBCVector4Dd.h"
00122 #include "SIBCVectorwd.h"
00123 #include "SIBCQuaterniond.h"
00124 #include "SIBCRotationd.h"
00125 #include "SIBCTransfod.h"
00126 #include "SIBCMatrixMNd.h"
00127 
00128 #endif