Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

nv_math.h

Go to the documentation of this file.
00001 /*********************************************************************NVMH1****
00002 File:
00003 nv_math.h
00004 
00005 Copyright (C) 1999, 2002 NVIDIA Corporation
00006 This file is provided without support, instruction, or implied warranty of any
00007 kind.  NVIDIA makes no guarantee of its fitness for a particular purpose and is
00008 not liable under any circumstances for any damages or loss whatsoever arising
00009 from the use or inability to use this file or items derived from it.
00010 
00011 Comments:
00012 
00013 
00014 ******************************************************************************/
00015 #ifndef _nv_math_h_
00016 #define _nv_math_h_
00017 
00018 #ifndef _nv_mathdecl_h_
00019 #include "nv_mathdecl.h"
00020 #endif // _nv_mathdecl_h_
00021 
00022 #include <assert.h>
00023 #include <math.h>
00024 
00025 #ifdef _WIN32
00026 #include <limits>
00027 #else
00028 #include <limits.h>
00029 #endif
00030 
00031 #ifdef MACOS
00032 #define sqrtf sqrt
00033 #define sinf sin
00034 #define cosf cos
00035 #define tanf tan
00036 #endif
00037 
00038 #include <memory.h>
00039 #include <stdlib.h>
00040 #include <float.h>
00041 
00042 typedef float nv_scalar;
00043 
00044 #define nv_zero               nv_scalar(0)
00045 #define nv_zero_5             nv_scalar(0.5)
00046 #define nv_one                nv_scalar(1.0)
00047 #define nv_two                nv_scalar(2)
00048 #define nv_half_pi            nv_scalar(3.14159265358979323846264338327950288419716939937510582 * 0.5)
00049 #define nv_quarter_pi         nv_scalar(3.14159265358979323846264338327950288419716939937510582 * 0.25)
00050 #define nv_pi                 nv_scalar(3.14159265358979323846264338327950288419716939937510582)
00051 #define nv_two_pi             nv_scalar(3.14159265358979323846264338327950288419716939937510582 * 2.0)
00052 #define nv_oo_pi              nv_one / nv_pi
00053 #define nv_oo_two_pi          nv_one / nv_two_pi
00054 #define nv_oo_255             nv_one / nv_scalar(255)
00055 #define nv_oo_128             nv_one / nv_scalar(128)
00056 #define nv_to_rad             nv_pi / nv_scalar(180)
00057 #define nv_to_deg             nv_scalar(180) / nv_pi
00058 #define nv_eps                nv_scalar(10e-6)
00059 #define nv_double_eps         nv_scalar(10e-6) * nv_two
00060 #define nv_big_eps            nv_scalar(10e-6)
00061 #define nv_small_eps          nv_scalar(10e-2)
00062 
00063 struct vec2;
00064 struct vec2t;
00065 struct vec3;
00066 struct vec3t;
00067 struct vec4;
00068 struct vec4t;
00069 
00070 #ifndef _nv_algebra_h_
00071 #include "nv_algebra.h"
00072 #endif // _nv_algebra_h_
00073 
00074 #endif //_nv_math_h_

Generated on Thu Apr 6 15:25:39 2006 for rcssserver3d by  doxygen 1.4.4