irplib_math_const.h

00001 /* $Id: irplib_math_const.h,v 1.1 2007/09/14 14:25:32 llundin Exp $
00002  *
00003  * This file is part of the ESO Common Pipeline Library
00004  * Copyright (C) 2001-2004 European Southern Observatory
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 /*
00022  * $Author: llundin $
00023  * $Date: 2007/09/14 14:25:32 $
00024  * $Revision: 1.1 $
00025  * $Name: uves-3_4_5 $
00026  */
00027 
00028 #ifndef IRPLIB_MATH_CONST_H
00029 #define IRPLIB_MATH_CONST_H
00030 
00031 /* FIXME: Drop once CPL 4.0 is no longer supported */
00032 
00033 /*-----------------------------------------------------------------------------
00034                                    Includes
00035  -----------------------------------------------------------------------------*/
00036 
00037 #include <cpl.h>
00038 
00039 /*-----------------------------------------------------------------------------
00040                                 Defines
00041  -----------------------------------------------------------------------------*/
00042 
00067 #ifdef CPL_MATH_CONST_H
00068 
00069 #define IRPLIB_MATH_E        CPL_MATH_E
00070 #define IRPLIB_MATH_PI       CPL_MATH_PI
00071 #define IRPLIB_MATH_LN2      CPL_MATH_LN2
00072 #define IRPLIB_MATH_LN10     CPL_MATH_LN10
00073 #define IRPLIB_MATH_2PI      CPL_MATH_2PI
00074 #define IRPLIB_MATH_PI_2     CPL_MATH_PI_2
00075 #define IRPLIB_MATH_PI_4     CPL_MATH_PI_4
00076 #define IRPLIB_MATH_1_PI     CPL_MATH_1_PI
00077 #define IRPLIB_MATH_2_PI     CPL_MATH_2_PI
00078 #define IRPLIB_MATH_4_PI     CPL_MATH_4_PI
00079 #define IRPLIB_MATH_SQRT2PI  CPL_MATH_SQRT2PI
00080 #define IRPLIB_MATH_2_SQRTPI CPL_MATH_2_SQRTPI
00081 #define IRPLIB_MATH_SQRT2    CPL_MATH_SQRT2
00082 #define IRPLIB_MATH_SQRT3    CPL_MATH_SQRT3
00083 #define IRPLIB_MATH_SQRT1_2  CPL_MATH_SQRT1_2
00084 #define IRPLIB_MATH_LOG2E    CPL_MATH_LOG2E
00085 #define IRPLIB_MATH_LOG10E   CPL_MATH_LOG10E
00086 #define IRPLIB_MATH_DEG_RAD  CPL_MATH_DEG_RAD
00087 #define IRPLIB_MATH_RAD_DEG  CPL_MATH_RAD_DEG
00088 #define IRPLIB_MATH_FWHM_SIG CPL_MATH_FWHM_SIG
00089 #define IRPLIB_MATH_SIG_FWHM CPL_MATH_SIG_FWHM
00090 
00091 #else
00092 
00093 /* The base of the exponential function */
00094 #define IRPLIB_MATH_E        2.7182818284590452353602874713526624977572470936999595
00095 
00096 /* The ratio of a circles circumference to its diameter */
00097 #define IRPLIB_MATH_PI       3.1415926535897932384626433832795028841971693993751058
00098 
00099 /* The natural logarithm of 2 */
00100 #define IRPLIB_MATH_LN2      0.6931471805599453094172321214581765680755001343602553
00101 
00102 /* The natural logarithm of 10 */
00103 #define IRPLIB_MATH_LN10     2.3025850929940456840179914546843642076011014886287730
00104 
00105 /* Derived constants */
00106 /* 2pi */
00107 #define IRPLIB_MATH_2PI      6.2831853071795864769252867665590057683943387987502116
00108 
00109 /* pi/2 */
00110 #define IRPLIB_MATH_PI_2     1.5707963267948966192313216916397514420985846996875529
00111 
00112 /* pi/4 */
00113 #define IRPLIB_MATH_PI_4     0.7853981633974483096156608458198757210492923498437765
00114 
00115 /* 1/pi */
00116 #define IRPLIB_MATH_1_PI     0.3183098861837906715377675267450287240689192914809129
00117 
00118 /* 2/pi */
00119 #define IRPLIB_MATH_2_PI     0.6366197723675813430755350534900574481378385829618258
00120 
00121 /* 4/pi */
00122 #define IRPLIB_MATH_4_PI     1.2732395447351626861510701069801148962756771659236516
00123 
00124 /* sqrt(2pi) */
00125 #define IRPLIB_MATH_SQRT2PI  2.5066282746310005024157652848110452530069867406099383
00126 
00127 /* 2/sqrt(pi) */
00128 #define IRPLIB_MATH_2_SQRTPI 1.1283791670955125738961589031215451716881012586579977
00129 
00130 /* sqrt(2) */
00131 #define IRPLIB_MATH_SQRT2    1.4142135623730950488016887242096980785696718753769481
00132 
00133 /* sqrt(3) */
00134 #define IRPLIB_MATH_SQRT3    1.7320508075688772935274463415058723669428052538103806
00135 
00136 /* sqrt(1/2) */
00137 #define IRPLIB_MATH_SQRT1_2  0.7071067811865475244008443621048490392848359376884740
00138 
00139 /* log2(e) */
00140 #define IRPLIB_MATH_LOG2E    1.4426950408889634073599246810018921374266459541529859
00141 
00142 /* log10(e) */
00143 #define IRPLIB_MATH_LOG10E   0.4342944819032518276511289189166050822943970058036666
00144 
00145 /* 180/pi */
00146 #define IRPLIB_MATH_DEG_RAD  57.295779513082320876798154814105170332405472466564322
00147 
00148 /* pi/180 */
00149 #define IRPLIB_MATH_RAD_DEG  0.0174532925199432957692369076848861271344287188854173
00150 
00151 /* FWHM per Sigma, 2.0*sqrt(2.0*log(2.0)) */
00152 #define IRPLIB_MATH_FWHM_SIG 2.3548200450309493820231386529193992754947713787716411
00153 
00154 /* Sigma per FWHM, 0.5/sqrt(2.0*log(2.0)) */
00155 #define IRPLIB_MATH_SIG_FWHM 0.4246609001440095213607514170514448098575705468921770
00156 
00157 #endif
00158 
00161 #endif
00162 

Generated on Thu Nov 15 14:32:26 2007 for UVES Pipeline Reference Manual by  doxygen 1.5.1