//////////////////////////////////////////////////////////////////////////////// // matrix.h // Creation : 20/01/2000 // Author : Leonardo FLOREZ VALENCIA // l-florez@uniandes.edu.co // lflorez@creatis.insa-lyon.fr // Copyright (C) 2000-2002 Leonardo FLOREZ VALENCIA // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //////////////////////////////////////////////////////////////////////////////// #ifndef GTMLIB__MATH__MATHDEFS__HXX #define GTMLIB__MATH__MATHDEFS__HXX #include /// PI constant. #define GTM_PI 3.14159265359 /// 2 * PI constant. #define GTM_PI2 6.28318530717 /// ln1 constant. #define GTM_NE 2.71828182846 /// Minimum. #define GTM_MIN( a, b ) ( ( ( a ) < ( b ) )? ( a ): ( b ) ) /// Maximum. #define GTM_MAX( a, b ) ( ( ( a ) > ( b ) )? ( a ): ( b ) ) #define GTM_POW2( a ) ( ( a ) * ( a ) ) // Useful typedefs. // Useless now // JPR /* typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; */ namespace gtm { /** Rounds a double number. * * @param n Number. */ inline double round( double n ) { double tmp; tmp = floor( n ); if ( ( n - tmp ) < 0.5 ) return( tmp ); else return( ceil( n ) ); } } #endif // GTMLIB__MATH__MATHDEFS__HXX // EOF - mathdefs.h