103 using namespace MSP::CCS;
 
  111 const double PI = 3.14159265358979323e0;  
 
  114 const double ONE = (1.0 * 
PI / 180);      
 
  119   return coeff * sin(c * Beta);
 
  130   es( .081819190842622 ),
 
  131   es2( 0.0066943799901413800 ),
 
  132   es4( 4.4814723452405e-005 ),
 
  133   es6( 3.0000678794350e-007 ),
 
  135   Cyeq_a_k0( 6378137.0 ),
 
  137   c0( .0022392088624809 ),
 
  138   c1( 2.8830839728915e-006 ),
 
  139   c2( 5.0331826636906e-009 ),
 
  140   Cyeq_Origin_Long( 0.0 ),
 
  141   Cyeq_Origin_Lat( 0.0 ),
 
  142   Cyeq_False_Easting( 0.0 ),
 
  143   Cyeq_False_Northing( 0.0 ),
 
  144   Cyeq_Max_Easting( 20037509.0 ),
 
  145   Cyeq_Min_Easting( -20037509.0 ),
 
  146   Cyeq_Delta_Northing( 6363886.0 )
 
  166   double Sin_Cyeq_Origin_Lat;
 
  167   double inv_f = 1 / ellipsoidFlattening;
 
  169   if (ellipsoidSemiMajorAxis <= 0.0)
 
  173   if ((inv_f < 250) || (inv_f > 350))
 
  181   if ((centralMeridian < -
PI) || (centralMeridian > 
TWO_PI))
 
  189   Cyeq_Origin_Lat = originLatitude;
 
  190   if (centralMeridian > 
PI)
 
  191     centralMeridian -= 
TWO_PI;
 
  192   Cyeq_Origin_Long = centralMeridian;
 
  193   Cyeq_False_Northing = falseNorthing;
 
  194   Cyeq_False_Easting = falseEasting;
 
  199   c0 = es2 / 3.0 + 31.0 * es4 / 180.0 + 517.0 * es6 / 5040.0;
 
  200   c1 = 23.0 * es4 / 360.0 + 251.0 * es6 / 3780.0;
 
  201   c2 = 761.0 * es6 / 45360.0;
 
  202   Sin_Cyeq_Origin_Lat = sin(Cyeq_Origin_Lat);
 
  203   k0 = cos(Cyeq_Origin_Lat) / sqrt(1.0 - es2 * Sin_Cyeq_Origin_Lat * Sin_Cyeq_Origin_Lat);
 
  207   if (Cyeq_Origin_Long > 0)
 
  211     Cyeq_Max_Easting = tempCoordinates->
easting();
 
  212     delete tempCoordinates;
 
  216     Cyeq_Min_Easting = tempCoordinates->
easting();
 
  217     delete tempCoordinates;
 
  221     Cyeq_Delta_Northing = tempCoordinates->
northing();
 
  222     delete tempCoordinates;
 
  224   else if (Cyeq_Origin_Long < 0)
 
  228     Cyeq_Max_Easting = tempCoordinates->
easting();
 
  229     delete tempCoordinates;
 
  233     Cyeq_Min_Easting = tempCoordinates->
easting();
 
  234     delete tempCoordinates;
 
  238     Cyeq_Delta_Northing = tempCoordinates->
northing();
 
  239     delete tempCoordinates;
 
  245     Cyeq_Max_Easting = tempCoordinates->
easting();
 
  246     Cyeq_Delta_Northing = tempCoordinates->
northing();
 
  247     delete tempCoordinates;
 
  248     Cyeq_Min_Easting = -Cyeq_Max_Easting;
 
  251   if(Cyeq_False_Northing)
 
  252     Cyeq_Delta_Northing -= Cyeq_False_Northing;
 
  253   if (Cyeq_Delta_Northing < 0)
 
  254     Cyeq_Delta_Northing = -Cyeq_Delta_Northing;
 
  256   if(Cyeq_False_Easting)
 
  258     Cyeq_Min_Easting -= Cyeq_False_Easting;
 
  259     Cyeq_Max_Easting -= Cyeq_False_Easting;
 
  273   Cyeq_a_k0 = cea.Cyeq_a_k0;
 
  278   Cyeq_Origin_Long = cea.Cyeq_Origin_Long;
 
  279   Cyeq_Origin_Lat = cea.Cyeq_Origin_Lat;
 
  280   Cyeq_False_Easting = cea.Cyeq_False_Easting;
 
  281   Cyeq_False_Northing = cea.Cyeq_False_Northing;
 
  282   Cyeq_Max_Easting = cea.Cyeq_Max_Easting;
 
  283   Cyeq_Min_Easting = cea.Cyeq_Min_Easting;
 
  284   Cyeq_Delta_Northing = cea.Cyeq_Delta_Northing;
 
  304     Cyeq_a_k0 = cea.Cyeq_a_k0;
 
  309     Cyeq_Origin_Long = cea.Cyeq_Origin_Long;
 
  310     Cyeq_Origin_Lat = cea.Cyeq_Origin_Lat;
 
  311     Cyeq_False_Easting = cea.Cyeq_False_Easting;
 
  312     Cyeq_False_Northing = cea.Cyeq_False_Northing;
 
  313     Cyeq_Max_Easting = cea.Cyeq_Max_Easting;
 
  314     Cyeq_Min_Easting = cea.Cyeq_Min_Easting;
 
  315     Cyeq_Delta_Northing = cea.Cyeq_Delta_Northing;
 
  363   double longitude = geodeticCoordinates->
longitude();
 
  364   double latitude = geodeticCoordinates->
latitude();
 
  365   double sin_lat = sin(latitude);
 
  371   if ((longitude < -
PI) || (longitude > 
TWO_PI))
 
  376   dlam = longitude - Cyeq_Origin_Long;
 
  386   qq = cyleqarQ( sin_lat, x );
 
  388   double easting = Cyeq_a_k0 * dlam + Cyeq_False_Easting;
 
  389   double northing = 
semiMajorAxis * qq / two_k0 + Cyeq_False_Northing;
 
  411   double sin2beta, sin4beta, sin6beta;
 
  420   double easting  = mapProjectionCoordinates->
easting();
 
  421   double northing = mapProjectionCoordinates->
northing();
 
  423   if ((easting < (Cyeq_False_Easting + Cyeq_Min_Easting))
 
  424       || (easting > (Cyeq_False_Easting + Cyeq_Max_Easting)))
 
  428   if ((northing < (Cyeq_False_Northing - fabs(Cyeq_Delta_Northing)))
 
  429       || (northing > (Cyeq_False_Northing + fabs(Cyeq_Delta_Northing))))
 
  434   dy = northing - Cyeq_False_Northing;
 
  435   dx = easting - Cyeq_False_Easting;
 
  437   qp = cyleqarQ( sin_lat, x );
 
  448   double latitude = beta + sin2beta + sin4beta + sin6beta;
 
  449   double longitude = Cyeq_Origin_Long + dx / Cyeq_a_k0;
 
  463   else if (longitude < -
PI)
 
  470 double CylindricalEqualArea::cyleqarQ( 
double slat, 
double x )
 
  472   return (1.0-es2)*(slat/(1.0-x*x)-(1.0/(2.0*es)) * log((1.0-x)/(1.0+x)));