]> git.mxchange.org Git - flightgear.git/blob - Math/fg_geodesy.h
a464516da6f653e6d8abfba0cace5dbbe9f1792a
[flightgear.git] / Math / fg_geodesy.h
1 /**************************************************************************
2  * fg_geodesy.h -- routines to convert between geodetic and geocentric 
3  *                 coordinate systems.
4  *
5  * Copied and adapted directly from LaRCsim/ls_geodesy.c
6  *
7  * See below for the complete original LaRCsim comments.
8  *
9  * $Id$
10  * (Log is kept at end of this file)
11  **************************************************************************/
12
13
14 #ifndef _FG_GEODESY_H
15 #define _FG_GEODESY_H
16
17
18 #ifdef __cplusplus                                                          
19 extern "C" {                            
20 #endif                                   
21
22
23 /* fgGeocToGeod(lat_geoc, radius, *lat_geod, *alt, *sea_level_r)
24  *     INPUTS:  
25  *         lat_geoc     Geocentric latitude, radians, + = North
26  *         radius       C.G. radius to earth center, ft
27  *
28  *     OUTPUTS:
29  *         lat_geod     Geodetic latitude, radians, + = North
30  *         alt          C.G. altitude above mean sea level, ft
31  *         sea_level_r  radius from earth center to sea level at
32  *                      local vertical (surface normal) of C.G.
33  */
34
35 void fgGeocToGeod( double lat_geoc, double radius, double
36                    *lat_geod, double *alt, double *sea_level_r );
37
38 /* fgGeodToGeoc( lat_geod, alt, *sl_radius, *lat_geoc )
39  *     INPUTS:  
40  *         lat_geod     Geodetic latitude, radians, + = North
41  *         alt          C.G. altitude above mean sea level, ft
42  *
43  *     OUTPUTS:
44  *         sl_radius    SEA LEVEL radius to earth center, ft (add Altitude to
45  *                      get true distance from earth center.
46  *         lat_geoc     Geocentric latitude, radians, + = North
47  *
48  */
49
50 void fgGeodToGeoc( double lat_geod, double alt, double *sl_radius,
51                    double *lat_geoc );
52
53
54
55 /***************************************************************************
56
57         TITLE:  ls_geodesy
58         
59 ----------------------------------------------------------------------------
60
61         FUNCTION:       Converts geocentric coordinates to geodetic positions
62
63 ----------------------------------------------------------------------------
64
65         MODULE STATUS:  developmental
66
67 ----------------------------------------------------------------------------
68
69         GENEALOGY:      Written as part of LaRCSim project by E. B. Jackson
70
71 ----------------------------------------------------------------------------
72
73         DESIGNED BY:    E. B. Jackson
74         
75         CODED BY:       E. B. Jackson
76         
77         MAINTAINED BY:  E. B. Jackson
78
79 ----------------------------------------------------------------------------
80
81         MODIFICATION HISTORY:
82         
83         DATE    PURPOSE                                         BY
84         
85         930208  Modified to avoid singularity near polar region.        EBJ
86         930602  Moved backwards calcs here from ls_step.                EBJ
87         931214  Changed erroneous Latitude and Altitude variables to 
88                 *lat_geod and *alt in routine ls_geoc_to_geod.          EBJ
89         940111  Changed header files from old ls_eom.h style to ls_types, 
90                 and ls_constants.  Also replaced old DATA type with new
91                 SCALAR type.                                            EBJ
92
93         CURRENT RCS HEADER:
94
95 $Header$
96 $Log$
97 Revision 1.3  1998/04/21 17:03:48  curt
98 Prepairing for C++ integration.
99
100 Revision 1.2  1998/01/22 02:59:38  curt
101 Changed #ifdef FILE_H to #ifdef _FILE_H
102
103 Revision 1.1  1997/07/31 23:13:14  curt
104 Initial revision.
105
106 Revision 1.1  1997/05/29 00:09:56  curt
107 Initial Flight Gear revision.
108
109  * Revision 1.5  1994/01/11  18:47:05  bjax
110  * Changed include files to use types and constants, not ls_eom.h
111  * Also changed DATA type to SCALAR type.
112  *
113  * Revision 1.4  1993/12/14  21:06:47  bjax
114  * Removed global variable references Altitude and Latitude.   EBJ
115  *
116  * Revision 1.3  1993/06/02  15:03:40  bjax
117  * Made new subroutine for calculating geodetic to geocentric; changed name
118  * of forward conversion routine from ls_geodesy to ls_geoc_to_geod.
119  *
120
121 ----------------------------------------------------------------------------
122
123         REFERENCES:
124
125                 [ 1]    Stevens, Brian L.; and Lewis, Frank L.: "Aircraft 
126                         Control and Simulation", Wiley and Sons, 1992.
127                         ISBN 0-471-61397-5                    
128
129
130 ----------------------------------------------------------------------------
131
132         CALLED BY:      ls_aux
133
134 ----------------------------------------------------------------------------
135
136         CALLS TO:
137
138 ----------------------------------------------------------------------------
139
140         INPUTS: 
141                 lat_geoc        Geocentric latitude, radians, + = North
142                 radius          C.G. radius to earth center, ft
143
144 ----------------------------------------------------------------------------
145
146         OUTPUTS:
147                 lat_geod        Geodetic latitude, radians, + = North
148                 alt             C.G. altitude above mean sea level, ft
149                 sea_level_r     radius from earth center to sea level at
150                                 local vertical (surface normal) of C.G.
151
152 --------------------------------------------------------------------------*/
153
154
155 #ifdef __cplusplus
156 }
157 #endif
158
159 #endif /* _FG_GEODESY_H */
160
161
162 /* $Log$
163 /* Revision 1.3  1998/04/21 17:03:48  curt
164 /* Prepairing for C++ integration.
165 /*
166  * Revision 1.2  1998/01/22 02:59:38  curt
167  * Changed #ifdef FILE_H to #ifdef _FILE_H
168  *
169  * Revision 1.1  1997/07/31 23:13:14  curt
170  * Initial revision.
171  *
172  */