~ubuntu-branches/ubuntu/vivid/proj/vivid

« back to all changes in this revision

Viewing changes to src/geocent.h

  • Committer: Bazaar Package Importer
  • Author(s): Peter S Galbraith
  • Date: 2002-01-11 10:27:12 UTC
  • Revision ID: james.westby@ubuntu.com-20020111102712-ayi18r8y2eesv0y9
Tags: upstream-4.4.5
ImportĀ upstreamĀ versionĀ 4.4.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef GEOCENT_H
 
2
#define GEOCENT_H
 
3
 
 
4
/***************************************************************************/
 
5
/* RSC IDENTIFIER:  GEOCENTRIC
 
6
 *
 
7
 * ABSTRACT
 
8
 *
 
9
 *    This component provides conversions between Geodetic coordinates (latitude,
 
10
 *    longitude in radians and height in meters) and Geocentric coordinates
 
11
 *    (X, Y, Z) in meters.
 
12
 *
 
13
 * ERROR HANDLING
 
14
 *
 
15
 *    This component checks parameters for valid values.  If an invalid value
 
16
 *    is found, the error code is combined with the current error code using 
 
17
 *    the bitwise or.  This combining allows multiple error codes to be
 
18
 *    returned. The possible error codes are:
 
19
 *
 
20
 *      GEOCENT_NO_ERROR        : No errors occurred in function
 
21
 *      GEOCENT_LAT_ERROR       : Latitude out of valid range
 
22
 *                                 (-90 to 90 degrees)
 
23
 *      GEOCENT_LON_ERROR       : Longitude out of valid range
 
24
 *                                 (-180 to 360 degrees)
 
25
 *      GEOCENT_A_ERROR         : Semi-major axis less than or equal to zero
 
26
 *      GEOCENT_B_ERROR         : Semi-minor axis less than or equal to zero
 
27
 *      GEOCENT_A_LESS_B_ERROR  : Semi-major axis less than semi-minor axis
 
28
 *
 
29
 *
 
30
 * REUSE NOTES
 
31
 *
 
32
 *    GEOCENTRIC is intended for reuse by any application that performs
 
33
 *    coordinate conversions between geodetic coordinates and geocentric
 
34
 *    coordinates.
 
35
 *    
 
36
 *
 
37
 * REFERENCES
 
38
 *    
 
39
 *    An Improved Algorithm for Geocentric to Geodetic Coordinate Conversion,
 
40
 *    Ralph Toms, February 1996  UCRL-JC-123138.
 
41
 *    
 
42
 *    Further information on GEOCENTRIC can be found in the Reuse Manual.
 
43
 *
 
44
 *    GEOCENTRIC originated from : U.S. Army Topographic Engineering Center
 
45
 *                                 Geospatial Information Division
 
46
 *                                 7701 Telegraph Road
 
47
 *                                 Alexandria, VA  22310-3864
 
48
 *
 
49
 * LICENSES
 
50
 *
 
51
 *    None apply to this component.
 
52
 *
 
53
 * RESTRICTIONS
 
54
 *
 
55
 *    GEOCENTRIC has no restrictions.
 
56
 *
 
57
 * ENVIRONMENT
 
58
 *
 
59
 *    GEOCENTRIC was tested and certified in the following environments:
 
60
 *
 
61
 *    1. Solaris 2.5 with GCC version 2.8.1
 
62
 *    2. Windows 95 with MS Visual C++ version 6
 
63
 *
 
64
 * MODIFICATIONS
 
65
 *
 
66
 *    Date              Description
 
67
 *    ----              -----------
 
68
 *
 
69
 *
 
70
 */
 
71
 
 
72
 
 
73
/***************************************************************************/
 
74
/*
 
75
 *                              DEFINES
 
76
 */
 
77
#define GEOCENT_NO_ERROR        0x0000
 
78
#define GEOCENT_LAT_ERROR       0x0001
 
79
#define GEOCENT_LON_ERROR       0x0002
 
80
#define GEOCENT_A_ERROR         0x0004
 
81
#define GEOCENT_B_ERROR         0x0008
 
82
#define GEOCENT_A_LESS_B_ERROR  0x0010
 
83
 
 
84
 
 
85
/***************************************************************************/
 
86
/*
 
87
 *                              FUNCTION PROTOTYPES
 
88
 */
 
89
 
 
90
/* ensure proper linkage to c++ programs */
 
91
#ifdef __cplusplus
 
92
extern "C" {
 
93
#endif
 
94
 
 
95
 
 
96
  long Set_Geocentric_Parameters (double a, 
 
97
                                  double b);
 
98
/*
 
99
 * The function Set_Geocentric_Parameters receives the ellipsoid parameters
 
100
 * as inputs and sets the corresponding state variables.
 
101
 *
 
102
 *    a  : Semi-major axis, in meters.          (input)
 
103
 *    b  : Semi-minor axis, in meters.          (input)
 
104
 */
 
105
 
 
106
 
 
107
  void Get_Geocentric_Parameters (double *a, 
 
108
                                  double *b);
 
109
/*
 
110
 * The function Get_Geocentric_Parameters returns the ellipsoid parameters
 
111
 * to be used in geocentric coordinate conversions.
 
112
 *
 
113
 *    a  : Semi-major axis, in meters.          (output)
 
114
 *    b  : Semi-minor axis, in meters.          (output)
 
115
 */
 
116
 
 
117
 
 
118
  long Convert_Geodetic_To_Geocentric (double Latitude,
 
119
                                       double Longitude,
 
120
                                       double Height,
 
121
                                       double *X,
 
122
                                       double *Y,
 
123
                                       double *Z);
 
124
/*
 
125
 * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates
 
126
 * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),
 
127
 * according to the current ellipsoid parameters.
 
128
 *
 
129
 *    Latitude  : Geodetic latitude in radians                     (input)
 
130
 *    Longitude : Geodetic longitude in radians                    (input)
 
131
 *    Height    : Geodetic height, in meters                       (input)
 
132
 *    X         : Calculated Geocentric X coordinate, in meters.   (output)
 
133
 *    Y         : Calculated Geocentric Y coordinate, in meters.   (output)
 
134
 *    Z         : Calculated Geocentric Z coordinate, in meters.   (output)
 
135
 *
 
136
 */
 
137
 
 
138
 
 
139
  void Convert_Geocentric_To_Geodetic (double X,
 
140
                                       double Y, 
 
141
                                       double Z,
 
142
                                       double *Latitude,
 
143
                                       double *Longitude,
 
144
                                       double *Height);
 
145
/*
 
146
 * The function Convert_Geocentric_To_Geodetic converts geocentric
 
147
 * coordinates (X, Y, Z) to geodetic coordinates (latitude, longitude, 
 
148
 * and height), according to the current ellipsoid parameters.
 
149
 *
 
150
 *    X         : Geocentric X coordinate, in meters.         (input)
 
151
 *    Y         : Geocentric Y coordinate, in meters.         (input)
 
152
 *    Z         : Geocentric Z coordinate, in meters.         (input)
 
153
 *    Latitude  : Calculated latitude value in radians.       (output)
 
154
 *    Longitude : Calculated longitude value in radians.      (output)
 
155
 *    Height    : Calculated height value, in meters.         (output)
 
156
 */
 
157
 
 
158
 
 
159
#ifdef __cplusplus
 
160
}
 
161
#endif
 
162
 
 
163
#endif /* GEOCENT_H */