dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ups.h
Go to the documentation of this file.
1 #ifndef UPS_H
2  #define UPS_H
3 /********************************************************************/
4 /* RSC IDENTIFIER: UPS
5  *
6  *
7  * ABSTRACT
8  *
9  * This component provides conversions between geodetic (latitude
10  * and longitude) coordinates and Universal Polar Stereographic (UPS)
11  * projection (hemisphere, easting, and northing) coordinates.
12  *
13  *
14  * ERROR HANDLING
15  *
16  * This component checks parameters for valid values. If an
17  * invalid value is found the error code is combined with the
18  * current error code using the bitwise or. This combining allows
19  * multiple error codes to be returned. The possible error codes
20  * are:
21  *
22  * UPS_NO_ERROR : No errors occurred in function
23  * UPS_LAT_ERROR : Latitude outside of valid range
24  * (North Pole: 83.5 to 90,
25  * South Pole: -79.5 to -90)
26  * UPS_LON_ERROR : longitude outside of valid range
27  * (-180 to 360 degrees)
28  * UPS_HEMISPHERE_ERROR : Invalid hemisphere ('N' or 'S')
29  * UPS_EASTING_ERROR : Easting outside of valid range,
30  * (0 to 4,000,000m)
31  * UPS_NORTHING_ERROR : Northing outside of valid range,
32  * (0 to 4,000,000m)
33  * UPS_A_ERROR : Semi-major axis less than or equal to zero
34  * UPS_INV_F_ERROR : Inverse flattening outside of valid range
35  * (250 to 350)
36  *
37  *
38  * REUSE NOTES
39  *
40  * UPS is intended for reuse by any application that performs a Universal
41  * Polar Stereographic (UPS) projection.
42  *
43  *
44  * REFERENCES
45  *
46  * Further information on UPS can be found in the Reuse Manual.
47  *
48  * UPS originated from : U.S. Army Topographic Engineering Center
49  * Geospatial Information Division
50  * 7701 Telegraph Road
51  * Alexandria, VA 22310-3864
52  *
53  *
54  * LICENSES
55  *
56  * None apply to this component.
57  *
58  *
59  * RESTRICTIONS
60  *
61  * UPS has no restrictions.
62  *
63  *
64  * ENVIRONMENT
65  *
66  * UPS was tested and certified in the following environments:
67  *
68  * 1. Solaris 2.5 with GCC version 2.8.1
69  * 2. Windows 95 with MS Visual C++ version 6
70  *
71  *
72  * MODIFICATIONS
73  *
74  * Date Description
75  * ---- -----------
76  * 06-11-95 Original Code
77  * 03-01-97 Original Code
78  *
79  *
80  */
81 
82 
83 /**********************************************************************/
84 /*
85  * DEFINES
86  */
87 
88  #define UPS_NO_ERROR 0x0000
89  #define UPS_LAT_ERROR 0x0001
90  #define UPS_LON_ERROR 0x0002
91  #define UPS_HEMISPHERE_ERROR 0x0004
92  #define UPS_EASTING_ERROR 0x0008
93  #define UPS_NORTHING_ERROR 0x0010
94  #define UPS_A_ERROR 0x0020
95  #define UPS_INV_F_ERROR 0x0040
96 
97 
98 /**********************************************************************/
99 /*
100  * FUNCTION PROTOTYPES
101  * for UPS.C
102  */
103 
104 /* ensure proper linkage to c++ programs */
105  #ifdef __cplusplus
106 extern "C" {
107  #endif
108 
109  int Set_UPS_Parameters( double a,
110  double f);
111 /*
112  * The function SET_UPS_PARAMETERS receives the ellipsoid parameters and sets
113  * the corresponding state variables. If any errors occur, the error code(s)
114  * are returned by the function, otherwise UPS_NO_ERROR is returned.
115  *
116  * a : Semi-major axis of ellipsoid in meters (input)
117  * f : Flattening of ellipsoid (input)
118  */
119 
120 
121  void Get_UPS_Parameters( double *a,
122  double *f);
123 /*
124  * The function Get_UPS_Parameters returns the current ellipsoid parameters.
125  *
126  * a : Semi-major axis of ellipsoid, in meters (output)
127  * f : Flattening of ellipsoid (output)
128  */
129 
130 
131  int Convert_Geodetic_To_UPS ( double Latitude,
132  double longitude,
133  char *Hemisphere,
134  double *Easting,
135  double *Northing);
136 /*
137  * The function Convert_Geodetic_To_UPS converts geodetic (latitude and
138  * longitude) coordinates to UPS (hemisphere, easting, and northing)
139  * coordinates, according to the current ellipsoid parameters. If any
140  * errors occur, the error code(s) are returned by the function,
141  * otherwide UPS_NO_ERROR is returned.
142  *
143  * Latitude : Latitude in radians (input)
144  * longitude : longitude in radians (input)
145  * Hemisphere : Hemisphere either 'N' or 'S' (output)
146  * Easting : Easting/X in meters (output)
147  * Northing : Northing/Y in meters (output)
148  */
149 
150 
151  int Convert_UPS_To_Geodetic(char Hemisphere,
152  double Easting,
153  double Northing,
154  double *Latitude,
155  double *longitude);
156 
157 /*
158  * The function Convert_UPS_To_Geodetic converts UPS (hemisphere, easting,
159  * and northing) coordinates to geodetic (latitude and longitude) coordinates
160  * according to the current ellipsoid parameters. If any errors occur, the
161  * error code(s) are returned by the function, otherwise UPS_NO_ERROR is
162  * returned.
163  *
164  * Hemisphere : Hemisphere either 'N' or 'S' (input)
165  * Easting : Easting/X in meters (input)
166  * Northing : Northing/Y in meters (input)
167  * Latitude : Latitude in radians (output)
168  * longitude : longitude in radians (output)
169  */
170 
171  #ifdef __cplusplus
172 }
173  #endif
174 
175 #endif /* UPS_H */
int32_t longitude
int Convert_UPS_To_Geodetic(char Hemisphere, double Easting, double Northing, double *Latitude, double *longitude)
Definition: ups.c:244
void Get_UPS_Parameters(double *a, double *f)
Definition: ups.c:158
tuple f
Definition: px_mkfw.py:81
int Convert_Geodetic_To_UPS(double Latitude, double longitude, char *Hemisphere, double *Easting, double *Northing)
Definition: ups.c:174
int Set_UPS_Parameters(double a, double f)
Definition: ups.c:125