101 using namespace MSP::CCS;
109 const double PI = 3.14159265358979323e0;
121 Eckert6::Eckert6(
double ellipsoidSemiMajorAxis,
double ellipsoidFlattening,
double centralMeridian,
double falseEasting,
double falseNorthing ) :
123 es2( 0.0066943799901413800 ),
124 es4( 4.4814723452405e-005 ),
125 es6( 3.0000678794350e-007 ),
126 Ra_Over_Sqrt_Two_Plus_PI( 2809695.5356062 ),
127 Inv_Ra_Over_Sqrt_Two_Plus_PI( 3.5591044913137e-007 ),
128 Eck6_Origin_Long( 0.0 ),
129 Eck6_False_Easting( 0.0 ),
130 Eck6_False_Northing( 0.0 ),
131 Eck6_Delta_Northing( 8826919.0 ),
132 Eck6_Max_Easting( 17653838.0 )
151 double inv_f = 1 / ellipsoidFlattening;
153 if (ellipsoidSemiMajorAxis <= 0.0)
157 if ((inv_f < 250) || (inv_f > 350))
161 if ((centralMeridian < -
PI) || (centralMeridian >
TWO_PI))
174 (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 /3024.0);
175 Ra_Over_Sqrt_Two_Plus_PI = Ra / (sqrt(2.0 +
PI));
176 Inv_Ra_Over_Sqrt_Two_Plus_PI = 1 / Ra_Over_Sqrt_Two_Plus_PI;
177 if (centralMeridian >
PI)
178 centralMeridian -=
TWO_PI;
179 Eck6_Origin_Long = centralMeridian;
180 Eck6_False_Easting = falseEasting;
181 Eck6_False_Northing = falseNorthing;
182 if (Eck6_Origin_Long > 0)
184 Eck6_Max_Easting = 17555761.0;
185 Eck6_Min_Easting = -17653839.0;
187 else if (Eck6_Origin_Long < 0)
189 Eck6_Max_Easting = 17653838.0;
190 Eck6_Min_Easting = -17555761.0;
194 Eck6_Max_Easting = 17653838.0;
195 Eck6_Min_Easting = -17653838.0;
207 Ra_Over_Sqrt_Two_Plus_PI = e.Ra_Over_Sqrt_Two_Plus_PI;
208 Inv_Ra_Over_Sqrt_Two_Plus_PI = e.Inv_Ra_Over_Sqrt_Two_Plus_PI;
209 Eck6_Origin_Long = e.Eck6_Origin_Long;
210 Eck6_False_Easting = e.Eck6_False_Easting;
211 Eck6_False_Northing = e.Eck6_False_Northing;
212 Eck6_Delta_Northing = e.Eck6_Delta_Northing;
213 Eck6_Max_Easting = e.Eck6_Max_Easting;
231 Ra_Over_Sqrt_Two_Plus_PI = e.Ra_Over_Sqrt_Two_Plus_PI;
232 Inv_Ra_Over_Sqrt_Two_Plus_PI = e.Inv_Ra_Over_Sqrt_Two_Plus_PI;
233 Eck6_Origin_Long = e.Eck6_Origin_Long;
234 Eck6_False_Easting = e.Eck6_False_Easting;
235 Eck6_False_Northing = e.Eck6_False_Northing;
236 Eck6_Delta_Northing = e.Eck6_Delta_Northing;
237 Eck6_Max_Easting = e.Eck6_Max_Easting;
262 Eck6_Origin_Long, Eck6_False_Easting, Eck6_False_Northing );
283 double delta_theta = 1.0;
284 double dt_tolerance = 4.85e-10;
288 double longitude = geodeticCoordinates->
longitude();
289 double latitude = geodeticCoordinates->
latitude();
290 double slat = sin(latitude);
291 double theta = latitude;
297 if ((longitude < -
PI) || (longitude >
TWO_PI))
302 dlam = longitude - Eck6_Origin_Long;
311 while (fabs(delta_theta) > dt_tolerance && count)
314 slat) / (1.0 + cos(theta));
315 theta += delta_theta;
323 Ra_Over_Sqrt_Two_Plus_PI * dlam * (1.0 + cos(theta)) + Eck6_False_Easting;
324 double northing = 2.0 * Ra_Over_Sqrt_Two_Plus_PI * theta + Eck6_False_Northing;
350 double longitude, latitude;
352 double easting = mapProjectionCoordinates->
easting();
353 double northing = mapProjectionCoordinates->
northing();
355 if ((easting < (Eck6_False_Easting + Eck6_Min_Easting))
356 || (easting > (Eck6_False_Easting + Eck6_Max_Easting)))
360 if ((northing < (Eck6_False_Northing - Eck6_Delta_Northing))
361 || (northing > (Eck6_False_Northing + Eck6_Delta_Northing)))
366 dy = northing - Eck6_False_Northing;
367 dx = easting - Eck6_False_Easting;
368 theta = Inv_Ra_Over_Sqrt_Two_Plus_PI * dy / 2.0;
377 Eck6_Origin_Long + Inv_Ra_Over_Sqrt_Two_Plus_PI * dx / (1 + cos(theta));
391 else if (longitude < -
PI)