dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
polarst.h
Go to the documentation of this file.
1 #ifndef POLARST_H
2  #define POLARST_H
3 /***************************************************************************/
4 /* RSC IDENTIFIER: POLAR STEREOGRAPHIC
5  *
6  *
7  * ABSTRACT
8  *
9  * This component provides conversions between geodetic (latitude and
10  * longitude) coordinates and Polar Stereographic (easting and northing)
11  * coordinates.
12  *
13  * ERROR HANDLING
14  *
15  * This component checks parameters for valid values. If an invalid
16  * value is found the error code is combined with the current error code
17  * using the bitwise or. This combining allows multiple error codes to
18  * be returned. The possible error codes are:
19  *
20  * POLAR_NO_ERROR : No errors occurred in function
21  * POLAR_LAT_ERROR : Latitude outside of valid range
22  * (-90 to 90 degrees)
23  * POLAR_LON_ERROR : longitude outside of valid range
24  * (-180 to 360 degrees)
25  * POLAR_ORIGIN_LAT_ERROR : Latitude of true scale outside of valid
26  * range (-90 to 90 degrees)
27  * POLAR_ORIGIN_LON_ERROR : longitude down from pole outside of valid
28  * range (-180 to 360 degrees)
29  * POLAR_EASTING_ERROR : Easting outside of valid range,
30  * depending on ellipsoid and
31  * projection parameters
32  * POLAR_NORTHING_ERROR : Northing outside of valid range,
33  * depending on ellipsoid and
34  * projection parameters
35  * POLAR_RADIUS_ERROR : Coordinates too far from pole,
36  * depending on ellipsoid and
37  * projection parameters
38  * POLAR_A_ERROR : Semi-major axis less than or equal to zero
39  * POLAR_INV_F_ERROR : Inverse flattening outside of valid range
40  * (250 to 350)
41  *
42  *
43  * REUSE NOTES
44  *
45  * POLAR STEREOGRAPHIC is intended for reuse by any application that
46  * performs a Polar Stereographic projection.
47  *
48  *
49  * REFERENCES
50  *
51  * Further information on POLAR STEREOGRAPHIC can be found in the
52  * Reuse Manual.
53  *
54  *
55  * POLAR STEREOGRAPHIC originated from :
56  * U.S. Army Topographic Engineering Center
57  * Geospatial Information Division
58  * 7701 Telegraph Road
59  * Alexandria, VA 22310-3864
60  *
61  *
62  * LICENSES
63  *
64  * None apply to this component.
65  *
66  *
67  * RESTRICTIONS
68  *
69  * POLAR STEREOGRAPHIC has no restrictions.
70  *
71  *
72  * ENVIRONMENT
73  *
74  * POLAR STEREOGRAPHIC was tested and certified in the following
75  * environments:
76  *
77  * 1. Solaris 2.5 with GCC, version 2.8.1
78  * 2. Window 95 with MS Visual C++, version 6
79  *
80  *
81  * MODIFICATIONS
82  *
83  * Date Description
84  * ---- -----------
85  * 06-11-95 Original Code
86  * 03-01-97 Original Code
87  *
88  *
89  */
90 
91 
92 /**********************************************************************/
93 /*
94  * DEFINES
95  */
96 
97  #define POLAR_NO_ERROR 0x0000
98  #define POLAR_LAT_ERROR 0x0001
99  #define POLAR_LON_ERROR 0x0002
100  #define POLAR_ORIGIN_LAT_ERROR 0x0004
101  #define POLAR_ORIGIN_LON_ERROR 0x0008
102  #define POLAR_EASTING_ERROR 0x0010
103  #define POLAR_NORTHING_ERROR 0x0020
104  #define POLAR_A_ERROR 0x0040
105  #define POLAR_INV_F_ERROR 0x0080
106  #define POLAR_RADIUS_ERROR 0x0100
107 
108 /**********************************************************************/
109 /*
110  * FUNCTION PROTOTYPES
111  */
112 
113 /* ensure proper linkage to c++ programs */
114  #ifdef __cplusplus
115 extern "C" {
116  #endif
117 
119  double f,
120  double Latitude_of_True_Scale,
121  double longitude_Down_from_Pole,
122  double False_Easting,
123  double False_Northing);
124 /*
125  * The function Set_Polar_Stereographic_Parameters receives the ellipsoid
126  * parameters and Polar Stereograpic projection parameters as inputs, and
127  * sets the corresponding state variables. If any errors occur, error
128  * code(s) are returned by the function, otherwise POLAR_NO_ERROR is returned.
129  *
130  * a : Semi-major axis of ellipsoid, in meters (input)
131  * f : Flattening of ellipsoid (input)
132  * Latitude_of_True_Scale : Latitude of true scale, in radians (input)
133  * longitude_Down_from_Pole : longitude down from pole, in radians (input)
134  * False_Easting : Easting (X) at center of projection, in meters (input)
135  * False_Northing : Northing (Y) at center of projection, in meters (input)
136  */
137 
138 
139  void Get_Polar_Stereographic_Parameters (double *a,
140  double *f,
141  double *Latitude_of_True_Scale,
142  double *longitude_Down_from_Pole,
143  double *False_Easting,
144  double *False_Northing);
145 /*
146  * The function Get_Polar_Stereographic_Parameters returns the current
147  * ellipsoid parameters and Polar projection parameters.
148  *
149  * a : Semi-major axis of ellipsoid, in meters (output)
150  * f : Flattening of ellipsoid (output)
151  * Latitude_of_True_Scale : Latitude of true scale, in radians (output)
152  * longitude_Down_from_Pole : longitude down from pole, in radians (output)
153  * False_Easting : Easting (X) at center of projection, in meters (output)
154  * False_Northing : Northing (Y) at center of projection, in meters (output)
155  */
156 
157 
158  int Convert_Geodetic_To_Polar_Stereographic (double Latitude,
159  double longitude,
160  double *Easting,
161  double *Northing);
162 /*
163  * The function Convert_Geodetic_To_Polar_Stereographic converts geodetic
164  * coordinates (latitude and longitude) to Polar Stereographic coordinates
165  * (easting and northing), according to the current ellipsoid
166  * and Polar Stereographic projection parameters. If any errors occur, error
167  * code(s) are returned by the function, otherwise POLAR_NO_ERROR is returned.
168  *
169  * Latitude : Latitude, in radians (input)
170  * longitude : longitude, in radians (input)
171  * Easting : Easting (X), in meters (output)
172  * Northing : Northing (Y), in meters (output)
173  */
174 
175 
176 
177  int Convert_Polar_Stereographic_To_Geodetic (double Easting,
178  double Northing,
179  double *Latitude,
180  double *longitude);
181 
182 /*
183  * The function Convert_Polar_Stereographic_To_Geodetic converts Polar
184  * Stereographic coordinates (easting and northing) to geodetic
185  * coordinates (latitude and longitude) according to the current ellipsoid
186  * and Polar Stereographic projection Parameters. If any errors occur, the
187  * code(s) are returned by the function, otherwise POLAR_NO_ERROR
188  * is returned.
189  *
190  * Easting : Easting (X), in meters (input)
191  * Northing : Northing (Y), in meters (input)
192  * Latitude : Latitude, in radians (output)
193  * longitude : longitude, in radians (output)
194  *
195  */
196 
197  #ifdef __cplusplus
198 }
199  #endif
200 
201 #endif /* POLARST_H */
202 
int Convert_Geodetic_To_Polar_Stereographic(double Latitude, double longitude, double *Easting, double *Northing)
Definition: polarst.c:305
int Convert_Polar_Stereographic_To_Geodetic(double Easting, double Northing, double *Latitude, double *longitude)
Definition: polarst.c:404
int32_t longitude
int Set_Polar_Stereographic_Parameters(double a, double f, double Latitude_of_True_Scale, double longitude_Down_from_Pole, double False_Easting, double False_Northing)
Definition: polarst.c:154
tuple f
Definition: px_mkfw.py:81
void Get_Polar_Stereographic_Parameters(double *a, double *f, double *Latitude_of_True_Scale, double *longitude_Down_from_Pole, double *False_Easting, double *False_Northing)
Definition: polarst.c:275