Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

pimath.h

Go to the documentation of this file.
00001 /*
00002  * Title:   pimath.h
00003  * Created: Wed May 17 23:54:26 2000
00004  * Authors: Gilbert Baumann, Tim Weyrich
00005  *
00006  * Copyright (c) 2000--2002
00007  * Gilbert Baumann <unk6@rz.uni-karlsruhe.de>
00008  * Markus Noga <markus@noga.de>
00009  * Tim Weyrich <weyrich@inf.ethz.ch>
00010  *
00011  * This file is part of the Pointshop3D system.
00012  * See http: *www.pointshop3d.com/ for more information.
00013  *
00014  * This program is free software; you can redistribute it and/or
00015  * modify it under the terms of the GNU Lesser General Public
00016  * License as published by the Free Software Foundation; either
00017  * version 2.1 of the License, or (at your option) any later
00018  * version.
00019  * 
00020  * This program is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  * GNU Lesser General Public License for more details.
00024  * 
00025  * You should have received a copy of the GNU Lesser General
00026  * Public License along with this library; if not, write to the
00027  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
00028  * Boston, MA 02111-1307 USA
00029  * 
00030  * Contact info@pointshop3d.com if any conditions of this
00031  * licensing are not clear to you.
00032  */
00033 
00034 #ifndef __PIMATH__
00035 #define __PIMATH__
00036 
00037 #include <pidefs.h>
00038 
00039 #include <math.h>
00040 
00041 #ifndef M_E
00042 #  define       M_E             2.7182818284590452354   /* e */
00043 #endif
00044 #ifndef M_LOG2E
00045 #  define       M_LOG2E         1.4426950408889634074   /* log 2e */
00046 #endif
00047 #ifndef M_LOG10E
00048 #  define       M_LOG10E        0.43429448190325182765  /* log 10e */
00049 #endif
00050 #ifndef M_LN2
00051 #  define       M_LN2           0.69314718055994530942  /* log e2 */
00052 #endif
00053 #ifndef M_LN10
00054 #  define       M_LN10          2.30258509299404568402  /* log e10 */
00055 #endif
00056 #ifndef M_PI
00057 #  define       M_PI            3.14159265358979323846  /* pi */
00058 #endif
00059 #ifndef M_PI_2
00060 #  define       M_PI_2          1.57079632679489661923  /* pi/2 */
00061 #endif
00062 #ifndef M_PI_4
00063 #  define       M_PI_4          0.78539816339744830962  /* pi/4 */
00064 #endif
00065 #ifndef M_1_PI
00066 #  define       M_1_PI          0.31830988618379067154  /* 1/pi */
00067 #endif
00068 #ifndef M_2_PI
00069 #  define       M_2_PI          0.63661977236758134308  /* 2/pi */
00070 #endif
00071 #ifndef M_2_SQRTPI
00072 #  define       M_2_SQRTPI      1.12837916709551257390  /* 2/sqrt(pi) */
00073 #endif
00074 #ifndef M_SQRT2
00075 #  define       M_SQRT2         1.41421356237309504880  /* sqrt(2) */
00076 #endif
00077 #ifndef M_SQRT1_2
00078 #  define       M_SQRT1_2       0.70710678118654752440  /* 1/sqrt(2) */
00079 #endif
00080 
00081 #ifdef __cplusplus
00082 extern "C" {
00083 #endif
00084 
00085 #if defined(_WIN32)
00086 # define isnan _isnan
00087   extern PI_API int isinf(double);
00088   extern PI_API double rint(double x);
00089 
00090   _CRTIMP int  __cdecl rand(void);
00091   static __inline double drand48() {
00092     return (double) rand();
00093   }
00094 
00095 #elif defined(__STRICT_ANSI__)
00096 
00097 #  define  rint   pi_rint
00098 #  define  isnan  pi_isnan
00099 
00100   extern PI_API int pi_isnan(double) __PI_THROW;
00101   extern PI_API int isinf(double) __PI_THROW;
00102 
00103   extern PI_API double pi_rint(double) __PI_THROW;
00104 #endif
00105 
00106 #ifdef __cplusplus
00107 }
00108 #endif
00109 
00110 #endif

Generated on Mon Sep 30 15:50:41 2002 for PointShop by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002