mathdefs.h

Go to the documentation of this file.
00001 
00002 // matrix.h
00003 // Creation : 20/01/2000
00004 // Author   : Leonardo FLOREZ VALENCIA
00005 //               l-florez@uniandes.edu.co
00006 //               lflorez@creatis.insa-lyon.fr
00007 // Copyright (C) 2000-2002 Leonardo FLOREZ VALENCIA
00008 //
00009 // This program is free software; you can redistribute it and/or
00010 // modify it under the terms of the GNU General Public License
00011 // as published by the Free Software Foundation; either version 2
00012 // of the License, or (at your option) any later version.
00013 //
00014 // This program is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with this program; if not, write to the Free Software
00021 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023 
00024 #ifndef GTMLIB__MATH__MATHDEFS__HXX
00025 #define GTMLIB__MATH__MATHDEFS__HXX
00026 
00027 #include <math.h>
00028 
00030 #define GTM_PI  3.14159265359
00032 #define GTM_PI2 6.28318530717
00034 #define GTM_NE  2.71828182846
00035 
00037 #define GTM_MIN( a, b ) ( ( ( a ) < ( b ) )? ( a ): ( b ) )
00039 #define GTM_MAX( a, b ) ( ( ( a ) > ( b ) )? ( a ): ( b ) )
00040 #define GTM_POW2( a ) ( ( a ) * ( a ) )
00041 
00042 // Useful typedefs. // Useless now // JPR
00043 /*
00044 typedef unsigned char  uchar;
00045 typedef unsigned short ushort;
00046 typedef unsigned int   uint;
00047 */
00048 
00049 namespace gtm
00050 {
00055     inline
00056     double round( double n )
00057     {
00058         double tmp;
00059         tmp = floor( n );
00060         if ( ( n - tmp ) < 0.5 )
00061             return( tmp );
00062         else
00063             return( ceil( n ) );
00064     }
00065 }
00066 
00067 #endif // GTMLIB__MATH__MATHDEFS__HXX
00068 
00069 // EOF - mathdefs.h

Generated on 20 Oct 2010 for creaMaracasVisu_lib by  doxygen 1.6.1