1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
26 ////////////////////////////////////////////////////////////////////////////////
28 // Creation : 20/01/2000
29 // Author : Leonardo FLOREZ VALENCIA
30 // l-florez@uniandes.edu.co
31 // lflorez@creatis.insa-lyon.fr
32 // Copyright (C) 2000-2002 Leonardo FLOREZ VALENCIA
34 // This program is free software; you can redistribute it and/or
35 // modify it under the terms of the GNU General Public License
36 // as published by the Free Software Foundation; either version 2
37 // of the License, or (at your option) any later version.
39 // This program is distributed in the hope that it will be useful,
40 // but WITHOUT ANY WARRANTY; without even the implied warranty of
41 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 // GNU General Public License for more details.
44 // You should have received a copy of the GNU General Public License
45 // along with this program; if not, write to the Free Software
46 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
47 ////////////////////////////////////////////////////////////////////////////////
49 #ifndef GTMLIB__MATH__MATHDEFS__HXX
50 #define GTMLIB__MATH__MATHDEFS__HXX
55 #define GTM_PI 3.14159265359
57 #define GTM_PI2 6.28318530717
59 #define GTM_NE 2.71828182846
62 #define GTM_MIN( a, b ) ( ( ( a ) < ( b ) )? ( a ): ( b ) )
64 #define GTM_MAX( a, b ) ( ( ( a ) > ( b ) )? ( a ): ( b ) )
65 #define GTM_POW2( a ) ( ( a ) * ( a ) )
67 // Useful typedefs. // Useless now // JPR
69 typedef unsigned char uchar;
70 typedef unsigned short ushort;
71 typedef unsigned int uint;
76 /** Rounds a double number.
81 double round( double n )
85 if ( ( n - tmp ) < 0.5 )
92 #endif // GTMLIB__MATH__MATHDEFS__HXX