constants.h

Go to the documentation of this file.
00001 /**
00002 \file    constants.h
00003 \brief   GNSS core 'c' function library: Contains constants.
00004 \author  Glenn D. MacGougan (GDM)
00005 \date    2007-11-29
00006 \since   2005-07-30
00007 
00008 \b "LICENSE INFORMATION" \n
00009 Copyright (c) 2007, refer to 'author' doxygen tags \n
00010 All rights reserved. \n
00011 
00012 Redistribution and use in source and binary forms, with or without
00013 modification, are permitted provided the following conditions are met: \n
00014 
00015 - Redistributions of source code must retain the above copyright
00016   notice, this list of conditions and the following disclaimer. \n
00017 - Redistributions in binary form must reproduce the above copyright
00018   notice, this list of conditions and the following disclaimer in the
00019   documentation and/or other materials provided with the distribution. \n
00020 - The name(s) of the contributor(s) may not be used to endorse or promote 
00021   products derived from this software without specific prior written 
00022   permission. \n
00023 
00024 THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS 
00025 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
00026 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00027 DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
00028 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00029 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
00030 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
00031 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
00032 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
00033 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
00034 SUCH DAMAGE.
00035 */
00036 
00037 #ifndef _C_CONSTANTS_H_
00038 #define _C_CONSTANTS_H_
00039 
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043 
00044 //#define PI (3.1415926535898) // value from GPS-ICD pp. 101 used in orbit curve fit calculations by the control segment
00045 
00046 #ifndef PI
00047 #define PI        (3.1415926535897932384626433832795) //!< better value
00048 #endif
00049 
00050 #ifndef TWOPI
00051 #define TWOPI     (6.283185307179586476925286766559)     //!< 2.0*PI
00052 #endif
00053 
00054 #ifndef HALFPI
00055 #define HALFPI    (1.5707963267948966192313216916398)    //!< PI/2.0
00056 #endif
00057 
00058 #ifdef QUARTERPI
00059 #define QUARTERPI (0.78539816339744830961566084581988)   //!< PI/4.0
00060 #endif
00061 
00062 #ifndef DEG2RAD
00063 #define DEG2RAD   (0.017453292519943295769236907684886)  //!< PI/180.0
00064 #endif
00065 
00066 #ifndef RAD2DEG
00067 #define RAD2DEG   (57.295779513082320876798154814105)    //!< 180.0/PI
00068 #endif
00069 
00070 #ifndef  SECONDS_IN_WEEK
00071 #define  SECONDS_IN_WEEK (604800.0) //!< [s]
00072 #endif
00073 
00074 #ifndef  LIGHTSPEED
00075 #define  LIGHTSPEED  (299792458.0) //!< light speed constant defined in ICD-GPS-200C p. 89  [m/s]
00076 #endif
00077 
00078 #ifndef  ONE_MS_IN_M
00079 #define  ONE_MS_IN_M (299792.4580) //!< 1 millisecond * light speed constant defined in ICD-GPS-200C p. 89  [m/s]
00080 #endif
00081 
00082 
00083 #ifndef GPS_FREQUENCYL1
00084 #define GPS_FREQUENCYL1  (1575.42e06) //!< [Hz]
00085 #endif
00086 
00087 #ifndef GPS_FREQUENCYL2
00088 #define GPS_FREQUENCYL2  (1227.60e06) //!< [Hz]
00089 #endif
00090 
00091 
00092 #ifndef GPS_WAVELENGTHL1
00093 #define GPS_WAVELENGTHL1 (0.19029367279836488047631742646405) //!< [m]
00094 #endif
00095 
00096 
00097 #ifndef GPS_WAVELENGTHL2
00098 #define GPS_WAVELENGTHL2 (0.24421021342456825) //!< [m]
00099 #endif
00100 
00101 
00102 // not a constant but a very common type
00103 #ifndef FALSE
00104 #define FALSE (0)
00105 #endif
00106 
00107 #ifndef TRUE
00108 #define TRUE (1)
00109 #endif
00110   
00111 #ifdef __cplusplus
00112 }
00113 #endif
00114 
00115 #endif // _C_CONSTANTS_H_
SourceForge.net Logo