Swarm-NG  1.1
astro_types.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Mario Juric *
3  * mjuric@astro.Princeton.EDU *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
26 #ifndef _astro_types_h
27 #define _astro_types_h
28 
29 #include <cmath>
30 
31 /*
32  * peyton library imported from another project (Mario Juric)
33  */
34 
35 namespace peyton {
36 
37 typedef double MJD;
38 typedef double JD;
39 typedef double Degrees;
40 typedef double Radians;
41 
42 template<typename T> inline T sqr(T x) { return x*x; }
43 template<typename T> inline T cube(const T &x) { return x*x*x; }
44 template<typename T> inline int sgn(T x) { return x > 0 ? 1 : (x < 0 ? -1 : 0); }
45 template<typename T> inline T sign(T a, T b) { return b >= 0 ? std::abs(a) : -std::abs(a); }
46 
47 }
48 
49 #define __peyton peyton
50 
51 #endif