4
/***************************************************************************/
5
/* RSC IDENTIFIER: GEOCENTRIC
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.
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:
20
* GEOCENT_NO_ERROR : No errors occurred in function
21
* GEOCENT_LAT_ERROR : Latitude out of valid range
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
32
* GEOCENTRIC is intended for reuse by any application that performs
33
* coordinate conversions between geodetic coordinates and geocentric
39
* An Improved Algorithm for Geocentric to Geodetic Coordinate Conversion,
40
* Ralph Toms, February 1996 UCRL-JC-123138.
42
* Further information on GEOCENTRIC can be found in the Reuse Manual.
44
* GEOCENTRIC originated from : U.S. Army Topographic Engineering Center
45
* Geospatial Information Division
47
* Alexandria, VA 22310-3864
51
* None apply to this component.
55
* GEOCENTRIC has no restrictions.
59
* GEOCENTRIC was tested and certified in the following environments:
61
* 1. Solaris 2.5 with GCC version 2.8.1
62
* 2. Windows 95 with MS Visual C++ version 6
73
/***************************************************************************/
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
85
/***************************************************************************/
90
/* ensure proper linkage to c++ programs */
96
long Set_Geocentric_Parameters (double a,
99
* The function Set_Geocentric_Parameters receives the ellipsoid parameters
100
* as inputs and sets the corresponding state variables.
102
* a : Semi-major axis, in meters. (input)
103
* b : Semi-minor axis, in meters. (input)
107
void Get_Geocentric_Parameters (double *a,
110
* The function Get_Geocentric_Parameters returns the ellipsoid parameters
111
* to be used in geocentric coordinate conversions.
113
* a : Semi-major axis, in meters. (output)
114
* b : Semi-minor axis, in meters. (output)
118
long Convert_Geodetic_To_Geocentric (double Latitude,
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.
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)
139
void Convert_Geocentric_To_Geodetic (double X,
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.
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)
163
#endif /* GEOCENT_H */