]> git.mxchange.org Git - flightgear.git/blob - LaRCsim/ls_constants.h
Moved fiddled with PI to avoid compiler warnings.
[flightgear.git] / LaRCsim / ls_constants.h
1 /***************************************************************************
2
3         TITLE:  ls_constants.h
4         
5 ----------------------------------------------------------------------------
6
7         FUNCTION:       LaRCSim constants definition header file
8
9 ----------------------------------------------------------------------------
10
11         MODULE STATUS:  developmental
12
13 ----------------------------------------------------------------------------
14
15         GENEALOGY:      Created 15 DEC 1993 by Bruce Jackson; was part of
16                         old ls_eom.h header file
17
18 ----------------------------------------------------------------------------
19
20         DESIGNED BY:    B. Jackson
21         
22         CODED BY:       B. Jackson
23         
24         MAINTAINED BY:  guess who
25
26 ----------------------------------------------------------------------------
27
28         MODIFICATION HISTORY:
29         
30         DATE    PURPOSE                                         BY
31                         
32 ----------------------------------------------------------------------------
33
34         REFERENCES:
35         
36                 [ 1]    McFarland, Richard E.: "A Standard Kinematic Model
37                         for Flight Simulation at NASA-Ames", NASA CR-2497,
38                         January 1975
39                         
40                 [ 2]    ANSI/AIAA R-004-1992 "Recommended Practice: Atmos-
41                         pheric and Space Flight Vehicle Coordinate Systems",
42                         February 1992
43                         
44                 [ 3]    Beyer, William H., editor: "CRC Standard Mathematical
45                         Tables, 28th edition", CRC Press, Boca Raton, FL, 1987,
46                         ISBN 0-8493-0628-0
47                         
48                 [ 4]    Dowdy, M. C.; Jackson, E. B.; and Nichols, J. H.:
49                         "Controls Analysis and Simulation Test Loop Environ-
50                         ment (CASTLE) Programmer's Guide, Version 1.3", 
51                         NATC TM 89-11, 30 March 1989.
52                         
53                 [ 5]    Halliday, David; and Resnick, Robert: "Fundamentals
54                         of Physics, Revised Printing", Wiley and Sons, 1974.
55                         ISBN 0-471-34431-1
56
57                 [ 6]    Anon: "U. S. Standard Atmosphere, 1962"
58                 
59                 [ 7]    Anon: "Aeronautical Vest Pocket Handbook, 17th edition",
60                         Pratt & Whitney Aircraft Group, Dec. 1977
61                         
62                 [ 8]    Stevens, Brian L.; and Lewis, Frank L.: "Aircraft 
63                         Control and Simulation", Wiley and Sons, 1992.
64                         ISBN 0-471-61397-5                      
65
66 --------------------------------------------------------------------------*/
67
68 #ifndef CONSTANTS
69
70 #define CONSTANTS -1
71
72 /* Define application-wide macros */
73
74 #define PATHNAME "LARCSIMPATH"
75 #ifndef NIL_POINTER
76 #define NIL_POINTER 0L
77 #endif
78
79 /* Define constants (note: many factors will need to change for other 
80         systems of measure)     */
81
82 /* Value of Pi from ref [3] */
83 #ifdef PI
84 #  undef PI /* avoid a harmless compiler warning */
85 #endif
86 #define PI 3.14159265358979323846264338327950288419716939967511
87
88 /* Value of earth radius from [8], ft */
89 #define EQUATORIAL_RADIUS 20925650.
90 #define RESQ 437882827922500.
91
92 /* Value of earth flattening parameter from ref [8]                     
93         
94         Note: FP = f
95               E  = 1-f
96               EPS = sqrt(1-(1-f)^2)                     */
97               
98 #define FP      .003352813178
99 #define E   .996647186
100 #define EPS .081819221
101 #define INVG .031080997
102
103 /* linear velocity of earth at equator from w*R; w=2pi/24 hrs, in ft/sec */
104 #define OMEGA_EARTH .00007272205217
105
106 /* miscellaneous units conversions (ref [7]) */
107 #define V_TO_KNOTS      0.5921
108 #define DEG_TO_RAD      0.017453292
109 #define RAD_TO_DEG      57.29577951
110 #define FT_TO_METERS    0.3048
111 #define METERS_TO_FT    3.2808
112 #define K_TO_R          1.8
113 #define R_TO_K          0.55555556
114 #define NSM_TO_PSF      0.02088547
115 #define PSF_TO_NSM      47.8801826
116 #define KCM_TO_SCF      0.00194106
117 #define SCF_TO_KCM      515.183616
118
119
120 /* ENGLISH Atmospheric reference properties [6] */
121 #define SEA_LEVEL_DENSITY       0.002376888
122
123 #endif
124
125 /*------------------------- end of ls_constants.h -------------------------*/