]> git.mxchange.org Git - simgear.git/blob - Math/fg_geodesy.hxx
714f60a2a06ddae207eae4a74351be0a54d0e59c
[simgear.git] / Math / fg_geodesy.hxx
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 (meters)
27  *
28  *     OUTPUTS:
29  *         lat_geod     Geodetic latitude, radians, + = North
30  *         alt          C.G. altitude above mean sea level (meters)
31  *         sea_level_r  radius from earth center to sea level at
32  *                      local vertical (surface normal) of C.G. (meters)
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 (meters)
42  *
43  *     OUTPUTS:
44  *         sl_radius    SEA LEVEL radius to earth center (meters)
45  *                      (add Altitude to 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.1  1998/10/16 19:30:42  curt
98 Renamed .c -> .h so we can start adding c++ supporting routines.
99
100 Revision 1.4  1998/07/08 14:40:08  curt
101 polar3d.[ch] renamed to polar3d.[ch]xx, vector.[ch] renamed to vector.[ch]xx
102 Updated fg_geodesy comments to reflect that routines expect and produce
103   meters.
104
105 Revision 1.3  1998/04/21 17:03:48  curt
106 Prepairing for C++ integration.
107
108 Revision 1.2  1998/01/22 02:59:38  curt
109 Changed #ifdef FILE_H to #ifdef _FILE_H
110
111 Revision 1.1  1997/07/31 23:13:14  curt
112 Initial revision.
113
114 Revision 1.1  1997/05/29 00:09:56  curt
115 Initial Flight Gear revision.
116
117  * Revision 1.5  1994/01/11  18:47:05  bjax
118  * Changed include files to use types and constants, not ls_eom.h
119  * Also changed DATA type to SCALAR type.
120  *
121  * Revision 1.4  1993/12/14  21:06:47  bjax
122  * Removed global variable references Altitude and Latitude.   EBJ
123  *
124  * Revision 1.3  1993/06/02  15:03:40  bjax
125  * Made new subroutine for calculating geodetic to geocentric; changed name
126  * of forward conversion routine from ls_geodesy to ls_geoc_to_geod.
127  *
128
129 ----------------------------------------------------------------------------
130
131         REFERENCES:
132
133                 [ 1]    Stevens, Brian L.; and Lewis, Frank L.: "Aircraft 
134                         Control and Simulation", Wiley and Sons, 1992.
135                         ISBN 0-471-61397-5                    
136
137
138 ----------------------------------------------------------------------------
139
140         CALLED BY:      ls_aux
141
142 ----------------------------------------------------------------------------
143
144         CALLS TO:
145
146 ----------------------------------------------------------------------------
147
148         INPUTS: 
149                 lat_geoc        Geocentric latitude, radians, + = North
150                 radius          C.G. radius to earth center, ft
151
152 ----------------------------------------------------------------------------
153
154         OUTPUTS:
155                 lat_geod        Geodetic latitude, radians, + = North
156                 alt             C.G. altitude above mean sea level, ft
157                 sea_level_r     radius from earth center to sea level at
158                                 local vertical (surface normal) of C.G.
159
160 --------------------------------------------------------------------------*/
161
162
163 #ifdef __cplusplus
164 }
165 #endif
166
167 #endif /* _FG_GEODESY_H */
168
169
170 /* $Log$
171 /* Revision 1.1  1998/10/16 19:30:42  curt
172 /* Renamed .c -> .h so we can start adding c++ supporting routines.
173 /*
174  * Revision 1.4  1998/07/08 14:40:08  curt
175  * polar3d.[ch] renamed to polar3d.[ch]xx, vector.[ch] renamed to vector.[ch]xx
176  * Updated fg_geodesy comments to reflect that routines expect and produce
177  *   meters.
178  *
179  * Revision 1.3  1998/04/21 17:03:48  curt
180  * Prepairing for C++ integration.
181  *
182  * Revision 1.2  1998/01/22 02:59:38  curt
183  * Changed #ifdef FILE_H to #ifdef _FILE_H
184  *
185  * Revision 1.1  1997/07/31 23:13:14  curt
186  * Initial revision.
187  *
188  */