1 // Vamos - a driving simulator 2 // Copyright (C) 2003 Sam Varner 3 // 4 // This program is free software; you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation; either version 2 of the License, or 7 // (at your option) any later version. 8 // 9 // This program is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with this program; if not, write to the Free Software 16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 18 #ifndef _CONSTANTS_H_ 19 #define _CONSTANTS_H_ 20 21 #include <cmath> 22 23 namespace Vamos_Geometry 24 { 25 #ifdef M_PI 26 const double pi = M_PI; 27 #else 28 const double pi = 3.14159265358979323846; 29 #endif 30 const double two_pi = 2.0 * pi; 31 32 #ifdef M_SQRT2 33 const double root_2 = M_SQRT2; 34 #else 35 const double root_2 = 1.41421356237309504880; 36 #endif 37 38 const double inv_root_2 = 1.0 / root_2; 39 40 enum Direction { NONE, IN, OUT, UP, DOWN, FORWARD, BACKWARD, LEFT, RIGHT }; 41 42 enum Axis { X, Y, Z }; 43 } 44 45 #endif 46