SIBCMathLib.h

00001 //***************************************************************************************
00002 //
00003 // File supervisor: Softimage 3D Games & 3D Bridge team
00004 //
00005 // (c) Copyright 1999-2002 Avid Technology, Inc. . All rights reserved.
00006 //
00007 // SIBCMathLib.h | Main header file for MathLib implementation
00008 //***************************************************************************************
00009 
00010 /****************************************************************************************
00011 THIS CODE IS PUBLISHED AS A SAMPLE ONLY AND IS PROVIDED "AS IS".
00012 IN NO EVENT SHALL SOFTIMAGE, AVID TECHNOLOGY, INC. AND/OR THEIR RESPECTIVE
00013 SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
00014 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00015 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
00016 CONNECTION WITH THE USE OR PERFORMANCE OF THIS CODE .
00017 
00018 COPYRIGHT NOTICE. Copyright © 1999-2002 Avid Technology Inc. . All rights reserved. 
00019 
00020 SOFTIMAGE is a registered trademark of Avid Technology Inc. or its subsidiaries 
00021 or divisions. Windows NT is a registered trademark of Microsoft Corp. All other
00022 trademarks contained herein are the property of their respective owners. 
00023 ****************************************************************************************/
00024 
00025 #if (_MSC_VER > 1000) || defined(SGI_COMPILER)
00026 #pragma once
00027 #endif
00028 
00029 //******************************************************************************
00030 // Defines
00031 //******************************************************************************
00032 
00033 #ifndef _SIBCMATHLIB_H_
00034 #define _SIBCMATHLIB_H_
00035 
00036 //******************************************************************************
00037 // Includes
00038 //******************************************************************************
00039 #include <math.h>       // for DBL_MAX
00040 #include <float.h>
00041 #include "SIBCUtil.h"
00042 
00043 
00049 typedef enum tagE3DAXISTYPE
00050 {
00051    X_AXIS = 0,  
00052    Y_AXIS = 1,  
00053    Z_AXIS = 2   
00054 } E3DAxisType;
00055 
00058 enum {  
00059     NO_COORD_AXIS   = 0x00,                                         
00060     X_COORD_AXIS    = 0x01,                                         
00061     Y_COORD_AXIS    = 0x02,                                         
00062     Z_COORD_AXIS    = 0x04,                                         
00063     ALL_COORD_AXES  = (X_COORD_AXIS | Y_COORD_AXIS | Z_COORD_AXIS)  
00064 } ;
00065 
00066 typedef double DOUBLE;              
00068 const DOUBLE PICO_EPS   = 1.0e-12;  
00069 const DOUBLE NANO_EPS   = 1.0e-09;  
00070 const DOUBLE HEXA_EPS   = 1.0e-06;  
00071 const DOUBLE MILLI_EPS  = 1.0e-03;  
00072 const DOUBLE SI_HUGE    = DBL_MAX;  
00075 #define M_PI    3.14159265358979323846  // already documented in SIBCMath.h
00076 #define M_E     2.7182818284590452354   // already documented in SIBCMath.h
00077 
00081 #define M_2PI            ( 2 * M_PI )   
00082 #define M_Inv_PI         ( 1.0 / M_PI ) 
00083 #define M_Inv_2PI        ( 0.5 / M_PI ) 
00090 #define DEG_TO_RAD( deg ) ((deg)*M_PI/180.0)
00091 
00097 #define RAD_TO_DEG( rad ) ((rad)*180.0*M_Inv_PI)
00098 
00100 // Old defines from S35MthConsts.h (these are not documented).
00101 #define SI_DEGREES_PER_RAD  (180.0/M_PI)
00102 #define SI_RAD_PER_DEGREES  (M_PI/180.0)
00103 #define _SI_RAD2DEG( x )    ( (x) * SI_DEGREES_PER_RAD )
00104 #define _SI_DEG2RAD( x )    ( (x) * SI_RAD_PER_DEGREES )
00105 
00109 #ifndef NULL
00110 
00111 #define NULL 0  
00112 #endif
00113 
00115 class CSIBCVector2Dd;
00116 class CSIBCVector3Dd;
00117 class CSIBCVector4Dd;
00118 class CSIBCVectorwd;
00119 class CSIBCMatrix33d;
00120 class CSIBCMatrix44d;
00121 class CSIBCMatrixMNd;
00122 class CSIBCRotMatd;
00123 class CSIBCXfoMatd;
00124 class C3DQuat;
00125 class CSIBCRotationd;
00126 class CSIBCTransfod;
00127 
00128 #include "SIBCMatrix33d.h"
00129 #include "SIBCRotMatd.h"
00130 #include "SIBCMatrix44d.h"
00131 #include "SIBCXfoMatd.h"
00132 #include "SIBCVector2Dd.h"
00133 #include "SIBCVector3Dd.h"
00134 #include "SIBCVector4Dd.h"
00135 #include "SIBCVectorwd.h"
00136 #include "SIBCQuaterniond.h"
00137 #include "SIBCRotationd.h"
00138 #include "SIBCTransfod.h"
00139 #include "SIBCMatrixMNd.h"
00140 
00141 #endif