00001 00002 /* This file is part of Rocs, 00003 Copyright (C) 2008 by: 00004 Tomaz Canabrava <tomaz.canabrava@gmail.com> 00005 Ugo Sangiori <ugorox@gmail.com> 00006 00007 Rocs is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 Rocs is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with Step; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #ifndef MATH_CONSTANTS_H 00023 #define MATH_CONSTANTS_H 00024 00025 00026 static const double Pi = 3.14159265358979323846264338327950288419717; 00027 00029 static const double TwoPi = 2.0 * Pi; 00030 00032 static const qreal PI_3 = Pi / 3.0; 00033 00035 static const qreal PI_2 = Pi / 2.0; 00036 00038 static const qreal PI_4 = Pi / 4.0; 00039 00041 static const qreal PI_8 = Pi / 8.0; 00042 00043 qreal rabs( qreal x ) 00044 { 00045 if( x < 0 ) return x * -1; 00046 return x; 00047 } 00048 #endif