dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tranmerc.h
Go to the documentation of this file.
1 #ifndef TRANMERC_H
2  #define TRANMERC_H
3 
4 /***************************************************************************/
5 /* RSC IDENTIFIER: TRANSVERSE MERCATOR
6  *
7  * ABSTRACT
8  *
9  * This component provides conversions between Geodetic coordinates
10  * (latitude and longitude) and Transverse Mercator projection coordinates
11  * (easting and northing).
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  * TRANMERC_NO_ERROR : No errors occurred in function
21  * TRANMERC_LAT_ERROR : Latitude outside of valid range
22  * (-90 to 90 degrees)
23  * TRANMERC_LON_ERROR : longitude outside of valid range
24  * (-180 to 360 degrees, and within
25  * +/-90 of Central Meridian)
26  * TRANMERC_EASTING_ERROR : Easting outside of valid range
27  * (depending on ellipsoid and
28  * projection parameters)
29  * TRANMERC_NORTHING_ERROR : Northing outside of valid range
30  * (depending on ellipsoid and
31  * projection parameters)
32  * TRANMERC_ORIGIN_LAT_ERROR : Origin latitude outside of valid range
33  * (-90 to 90 degrees)
34  * TRANMERC_CENT_MER_ERROR : Central meridian outside of valid range
35  * (-180 to 360 degrees)
36  * TRANMERC_A_ERROR : Semi-major axis less than or equal to zero
37  * TRANMERC_INV_F_ERROR : Inverse flattening outside of valid range
38  * (250 to 350)
39  * TRANMERC_SCALE_FACTOR_ERROR : Scale factor outside of valid
40  * range (0.3 to 3.0)
41  * TM_LON_WARNING : Distortion will result if longitude is more
42  * than 9 degrees from the Central Meridian
43  *
44  * REUSE NOTES
45  *
46  * TRANSVERSE MERCATOR is intended for reuse by any application that
47  * performs a Transverse Mercator projection or its inverse.
48  *
49  * REFERENCES
50  *
51  * Further information on TRANSVERSE MERCATOR can be found in the
52  * Reuse Manual.
53  *
54  * TRANSVERSE MERCATOR originated from :
55  * U.S. Army Topographic Engineering Center
56  * Geospatial Information Division
57  * 7701 Telegraph Road
58  * Alexandria, VA 22310-3864
59  *
60  * LICENSES
61  *
62  * None apply to this component.
63  *
64  * RESTRICTIONS
65  *
66  * TRANSVERSE MERCATOR has no restrictions.
67  *
68  * ENVIRONMENT
69  *
70  * TRANSVERSE MERCATOR was tested and certified in the following
71  * environments:
72  *
73  * 1. Solaris 2.5 with GCC, version 2.8.1
74  * 2. Windows 95 with MS Visual C++, version 6
75  *
76  * MODIFICATIONS
77  *
78  * Date Description
79  * ---- -----------
80  * 10-02-97 Original Code
81  * 03-02-97 Re-engineered Code
82  *
83  */
84 
85 
86 /***************************************************************************/
87 /*
88  * DEFINES
89  */
90 
91  #define TRANMERC_NO_ERROR 0x0000
92  #define TRANMERC_LAT_ERROR 0x0001
93  #define TRANMERC_LON_ERROR 0x0002
94  #define TRANMERC_EASTING_ERROR 0x0004
95  #define TRANMERC_NORTHING_ERROR 0x0008
96  #define TRANMERC_ORIGIN_LAT_ERROR 0x0010
97  #define TRANMERC_CENT_MER_ERROR 0x0020
98  #define TRANMERC_A_ERROR 0x0040
99  #define TRANMERC_INV_F_ERROR 0x0080
100  #define TRANMERC_SCALE_FACTOR_ERROR 0x0100
101  #define TRANMERC_LON_WARNING 0x0200
102 
103 
104 /***************************************************************************/
105 /*
106  * FUNCTION PROTOTYPES
107  * for TRANMERC.C
108  */
109 
110 /* ensure proper linkage to c++ programs */
111  #ifdef __cplusplus
112 extern "C" {
113  #endif
114 
115 
117  double f,
118  double Origin_Latitude,
119  double Central_Meridian,
120  double False_Easting,
121  double False_Northing,
122  double Scale_Factor);
123 /*
124  * The function Set_Tranverse_Mercator_Parameters receives the ellipsoid
125  * parameters and Tranverse Mercator projection parameters as inputs, and
126  * sets the corresponding state variables. If any errors occur, the error
127  * code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
128  * returned.
129  *
130  * a : Semi-major axis of ellipsoid, in meters (input)
131  * f : Flattening of ellipsoid (input)
132  * Origin_Latitude : Latitude in radians at the origin of the (input)
133  * projection
134  * Central_Meridian : longitude in radians at the center of the (input)
135  * projection
136  * False_Easting : Easting/X at the center of the projection (input)
137  * False_Northing : Northing/Y at the center of the projection (input)
138  * Scale_Factor : Projection scale factor (input)
139  */
140 
141 
142  void Get_Transverse_Mercator_Parameters(double *a,
143  double *f,
144  double *Origin_Latitude,
145  double *Central_Meridian,
146  double *False_Easting,
147  double *False_Northing,
148  double *Scale_Factor);
149 /*
150  * The function Get_Transverse_Mercator_Parameters returns the current
151  * ellipsoid and Transverse Mercator projection parameters.
152  *
153  * a : Semi-major axis of ellipsoid, in meters (output)
154  * f : Flattening of ellipsoid (output)
155  * Origin_Latitude : Latitude in radians at the origin of the (output)
156  * projection
157  * Central_Meridian : longitude in radians at the center of the (output)
158  * projection
159  * False_Easting : Easting/X at the center of the projection (output)
160  * False_Northing : Northing/Y at the center of the projection (output)
161  * Scale_Factor : Projection scale factor (output)
162  */
163 
164 
165  int Convert_Geodetic_To_Transverse_Mercator (double Latitude,
166  double longitude,
167  double *Easting,
168  double *Northing);
169 
170 /*
171  * The function Convert_Geodetic_To_Transverse_Mercator converts geodetic
172  * (latitude and longitude) coordinates to Transverse Mercator projection
173  * (easting and northing) coordinates, according to the current ellipsoid
174  * and Transverse Mercator projection coordinates. If any errors occur, the
175  * error code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
176  * returned.
177  *
178  * Latitude : Latitude in radians (input)
179  * longitude : longitude in radians (input)
180  * Easting : Easting/X in meters (output)
181  * Northing : Northing/Y in meters (output)
182  */
183 
184 
185  int Convert_Transverse_Mercator_To_Geodetic (double Easting,
186  double Northing,
187  double *Latitude,
188  double *longitude);
189 
190 /*
191  * The function Convert_Transverse_Mercator_To_Geodetic converts Transverse
192  * Mercator projection (easting and northing) coordinates to geodetic
193  * (latitude and longitude) coordinates, according to the current ellipsoid
194  * and Transverse Mercator projection parameters. If any errors occur, the
195  * error code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
196  * returned.
197  *
198  * Easting : Easting/X in meters (input)
199  * Northing : Northing/Y in meters (input)
200  * Latitude : Latitude in radians (output)
201  * longitude : longitude in radians (output)
202  */
203 
204 
205  #ifdef __cplusplus
206 }
207  #endif
208 
209 #endif /* TRANMERC_H */
int Convert_Geodetic_To_Transverse_Mercator(double Latitude, double longitude, double *Easting, double *Northing)
Definition: tranmerc.c:302
int32_t longitude
int Convert_Transverse_Mercator_To_Geodetic(double Easting, double Northing, double *Latitude, double *longitude)
Definition: tranmerc.c:457
void Get_Transverse_Mercator_Parameters(double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing, double *Scale_Factor)
Definition: tranmerc.c:266
int Set_Transverse_Mercator_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing, double Scale_Factor)
Definition: tranmerc.c:161
tuple f
Definition: px_mkfw.py:81