00001 // 00002 // "$Id: math.h,v 1.1.1.1 2002/11/26 22:02:17 pv9f Exp $" 00003 // 00004 // Math header file for the Fast Light Tool Kit (FLTK). 00005 // 00006 // Copyright 1998-2002 by Bill Spitzak and others. 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Library General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2 of the License, or (at your option) any later version. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 // Library General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU Library General Public 00019 // License along with this library; if not, write to the Free Software 00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00021 // USA. 00022 // 00023 // Please report all bugs and problems to "fltk-bugs@fltk.org". 00024 // 00025 00026 #ifndef fl_math_h 00027 #define fl_math_h 00028 00029 #include <math.h> 00030 00031 #ifdef WIN32 00032 // things missing from <math.h>: 00033 00034 #define M_PI 3.14159265358979323846 00035 #define M_PI_2 1.57079632679489661923 00036 #define M_PI_4 0.78539816339744830962 00037 #define M_1_PI 0.31830988618379067154 00038 #define M_2_PI 0.63661977236758134308 00039 #define M_SQRT2 1.41421356237309504880 00040 #define M_SQRT1_2 0.70710678118654752440 00041 00042 #else 00043 00044 #ifdef __EMX__ 00045 #include <float.h> 00046 #endif 00047 00048 #endif 00049 00050 #if defined(WIN32) || defined(CRAY) 00051 00052 inline double rint(double v) {return floor(v+.5);} 00053 inline double copysign(double a, double b) {return b<0 ? -a : a;} 00054 00055 #endif 00056 00057 #endif 00058 00059 // 00060 // End of "$Id: math.h,v 1.1.1.1 2002/11/26 22:02:17 pv9f Exp $". 00061 //
1.2.18