00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __CSIBC_MATH_H__
00029 #define __CSIBC_MATH_H__
00030
00031
00032 #ifndef XSICOREEXPORT
00033 # if ((defined _WIN32) || (defined WIN32)) && !(defined _WIN32_WCE) && !(defined _XBOX)
00034 # ifdef XSICORE_IMPL
00035 # define XSICOREEXPORT __declspec(dllexport)
00036 # elif defined(XSICORE_STATIC)
00037 # define XSICOREEXPORT
00038 # else
00039 # define XSICOREEXPORT __declspec(dllimport)
00040 # endif
00041 # else
00042 # define XSICOREEXPORT
00043 # endif
00044 #endif
00045
00046
00047
00048
00049 #include <math.h>
00050 #include <float.h>
00051
00052
00053
00054
00055
00060 #define SI_DODECA_EPS 1.0e-12
00061 #define SI_FLOAT_MIN FLT_MIN
00062 #define SI_FLOAT_MAX FLT_MAX
00063 #define SI_TWO_PI ( 2 * M_PI )
00064 #define SI_QUADRA_EPS 0.0001
00065 #define SI_PROJ_EPS1 0.0002
00066 #define SI_PROJ_EPS2 0.001
00067 #define SI_EPSILON 0.0001
00068 #define SI_PENTA_EPS 1.0e-05
00069 #define SI_HEXA_EPS 1.0e-6
00072 // The follow are not used, and should be removed in future versions.
00073 #define SI_LENGTH_EPS 0.01
00074 #define SI_VOLUME_EPS 5.0e-3
00075 #define SI_PREC 1e-6
00076 #define SI_IK_EPS2 0.0008
00077 #define SI_IK_EPS1 0.00001
00078 #define SI_PROT_EPS 0.05
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 #ifndef M_E
00089
00094 #define M_E 2.7182818284590452354
00095 #define M_LOG2E 1.4426950408889634074
00096 #define M_LOG10E 0.43429448190325182765
00097 #define M_LN2 0.69314718055994530942
00098 #define M_PI_4 0.78539816339744830962
00099 #define M_1_PI 0.31830988618379067154
00100 #define M_2_PI 0.63661977236758134308
00101 #define M_SQRT1_2 0.70710678118654752440
00104 #endif
00105
00109 #define M_LN10 2.30258509299404568402
00112 #ifndef M_PI
00113
00116 #define M_PI 3.14159265358979323846
00118 #endif
00119
00123 #define M_PI_2 1.57079632679489661923
00124 #define M_2_SQRTPI 1.12837916709551257390
00125 #define M_SQRT2 1.41421356237309504880
00126 #define MAXINT INT_MAX
00129
00130
00131
00132
00133
00134 #define _2PI (2.0 * M_PI)
00135 #define _1_2PI (0.5 * M_1_PI)
00136 #define INVERTPARAMCUBIC_TOL 1.0e-09
00137 #define INVERTPARAMCUBIC_SMALLERTOL 1.0e-20
00138 #define INVERTPARAMCUBIC_MAXIT 100
00139
00140
00141
00142
00143
00144
00154 XSICOREEXPORT float angleDistance ( double angle1, double angle2 );
00155
00161 XSICOREEXPORT float arcSinCos ( double sinus, double cosinus );
00162
00171 XSICOREEXPORT float InvertParamCubic ( float Param, float x0, float x1, float x2, float x3 );
00172
00178 #define _SI_LIMIT( x, a, b ) if (x < a) x = a; if (x > b) x = b;
00179
00181 #endif //