4
/***************************************************************************/
5
/* RSC IDENTIFIER: VAN DER GRINTEN
9
* This component provides conversions between Geodetic coordinates
10
* (latitude and longitude in radians) and Van Der Grinten projection coordinates
11
* (easting and northing 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
* GRIN_NO_ERROR : No errors occurred in function
21
* GRIN_LAT_ERROR : Latitude outside of valid range
23
* GRIN_LON_ERROR : Longitude outside of valid range
24
* (-180 to 360 degrees)
25
* GRIN_EASTING_ERROR : Easting outside of valid range
26
* (False_Easting +/- ~20,000,000 m,
27
* depending on ellipsoid parameters)
28
* GRIN_NORTHING_ERROR : Northing outside of valid range
29
* (False_Northing +/- ~20,000,000 m,
30
* depending on ellipsoid parameters)
31
* GRIN_RADIUS_ERROR : Coordinates too far from pole,
32
* depending on ellipsoid and
33
* projection parameters
34
* GRIN_CENT_MER_ERROR : Central meridian outside of valid range
35
* (-180 to 360 degrees)
36
* GRIN_A_ERROR : Semi-major axis less than or equal to zero
37
* GRIN_INV_F_ERROR : Inverse flattening outside of valid range
42
* VAN DER GRINTEN is intended for reuse by any application that performs a
43
* Van Der Grinten projection or its inverse.
47
* Further information on VAN DER GRINTEN can be found in the Reuse Manual.
49
* VAN DER GRINTEN originated from : U.S. Army Topographic Engineering Center
50
* Geospatial Information Division
52
* Alexandria, VA 22310-3864
56
* None apply to this component.
60
* VAN DER GRINTEN has no restrictions.
64
* VAN DER GRINTEN was tested and certified in the following environments:
66
* 1. Solaris 2.5 with GCC, version 2.8.1
67
* 2. Windows 95 with MS Visual C++, version 6
73
* 10-02-97 Original Code
78
/***************************************************************************/
83
#define GRIN_NO_ERROR 0x0000
84
#define GRIN_LAT_ERROR 0x0001
85
#define GRIN_LON_ERROR 0x0002
86
#define GRIN_EASTING_ERROR 0x0004
87
#define GRIN_NORTHING_ERROR 0x0008
88
#define GRIN_CENT_MER_ERROR 0x0020
89
#define GRIN_A_ERROR 0x0040
90
#define GRIN_INV_F_ERROR 0x0080
91
#define GRIN_RADIUS_ERROR 0x0100
94
/***************************************************************************/
100
/* ensure proper linkage to c++ programs */
105
long Set_Van_der_Grinten_Parameters(double a,
107
double Central_Meridian,
108
double False_Easting,
109
double False_Northing);
112
* The function Set_Van_der_Grinten_Parameters receives the ellipsoid parameters and
113
* Van Der Grinten projcetion parameters as inputs, and sets the corresponding state
114
* variables. If any errors occur, the error code(s) are returned by the function, otherwise
115
* GRIN_NO_ERROR is returned.
117
* a : Semi-major axis of ellipsoid, in meters (input)
118
* f : Flattening of ellipsoid (input)
119
* Central_Meridian : Longitude in radians at the center of (input)
121
* False_Easting : A coordinate value in meters assigned to the
122
* central meridian of the projection. (input)
123
* False_Northing : A coordinate value in meters assigned to the
124
* origin latitude of the projection (input)
128
void Get_Van_der_Grinten_Parameters(double *a,
130
double *Central_Meridian,
131
double *False_Easting,
132
double *False_Northing);
135
* The function Get_Van_der_Grinten_Parameters returns the current ellipsoid
136
* parameters, and Van Der Grinten projection parameters.
138
* a : Semi-major axis of ellipsoid, in meters (output)
139
* f : Flattening of ellipsoid (output)
140
* Central_Meridian : Longitude in radians at the center of (output)
142
* False_Easting : A coordinate value in meters assigned to the
143
* central meridian of the projection. (output)
144
* False_Northing : A coordinate value in meters assigned to the
145
* origin latitude of the projection (output)
149
long Convert_Geodetic_To_Van_der_Grinten (double Latitude,
154
* The function Convert_Geodetic_To_Van_der_Grinten converts geodetic (latitude and
155
* longitude) coordinates to Van Der Grinten projection easting, and northing
156
* coordinates, according to the current ellipsoid and Van Der Grinten projection
157
* parameters. If any errors occur, the error code(s) are returned by the
158
* function, otherwise GRIN_NO_ERROR is returned.
160
* Latitude : Latitude (phi) in radians (input)
161
* Longitude : Longitude (lambda) in radians (input)
162
* Easting : Easting (X) in meters (output)
163
* Northing : Northing (Y) in meters (output)
167
long Convert_Van_der_Grinten_To_Geodetic(double Easting,
172
* The function Convert_Van_der_Grinten_To_Geodetic converts Van Der Grinten projection
173
* easting and northing coordinates to geodetic (latitude and longitude)
174
* coordinates, according to the current ellipsoid and Van Der Grinten projection
175
* coordinates. If any errors occur, the error code(s) are returned by the
176
* function, otherwise GRIN_NO_ERROR is returned.
178
* Easting : Easting (X) in meters (input)
179
* Northing : Northing (Y) in meters (input)
180
* Latitude : Latitude (phi) in radians (output)
181
* Longitude : Longitude (lambda) in radians (output)
188
#endif /* GRINTEN_H */