function E_N_to_Long($East, $North, $a, $b, $e0, $n0, $f0, $PHI0, $LAM0)
 {
     #Un-project Transverse Mercator eastings and northings back to longitude.
     #Input: - _
     #eastings (East) and northings (North) in meters; _
     #ellipsoid axis dimensions (a & b) in meters; _
     #eastings (e0) and northings (n0) of false origin in meters; _
     #central meridian scale factor (f0) and _
     #latitude (PHI0) and longitude (LAM0) of false origin in decimal degrees.
     #REQUIRES THE "Marc" AND "InitialLat" FUNCTIONS
     #Convert angle measures to radians
     $Pi = 3.14159265358979;
     $RadPHI0 = $PHI0 * ($Pi / 180);
     $RadLAM0 = $LAM0 * ($Pi / 180);
     #Compute af0, bf0, e squared (e2), n and Et
     $af0 = $a * $f0;
     $bf0 = $b * $f0;
     $e2 = (pow($af0, 2) - pow($bf0, 2)) / pow($af0, 2);
     $n = ($af0 - $bf0) / ($af0 + $bf0);
     $Et = $East - $e0;
     #Compute initial value for latitude (PHI) in radians
     $PHId = $this->InitialLat($North, $n0, $af0, $RadPHI0, $n, $bf0);
     #Compute nu, rho and eta2 using value for PHId
     $nu = $af0 / sqrt(1 - $e2 * pow(sin($PHId), 2));
     $rho = $nu * (1 - $e2) / (1 - $e2 * pow(Sin($PHId), 2));
     $eta2 = $nu / $rho - 1;
     #Compute Longitude
     $X = pow(cos($PHId), -1) / $nu;
     $XI = pow(cos($PHId), -1) / (6 * pow($nu, 3)) * ($nu / $rho + 2 * pow(tan($PHId), 2));
     $XII = pow(cos($PHId), -1) / (120 * pow($nu, 5)) * (5 + 28 * pow(tan($PHId), 2) + 24 * pow(tan($PHId), 4));
     $XIIA = pow(Cos($PHId), -1) / (5040 * pow($nu, 7)) * (61 + 662 * pow(tan($PHId), 2) + 1320 * pow(Tan($PHId), 4) + 720 * pow(tan($PHId), 6));
     $E_N_to_Long = 180 / $Pi * ($RadLAM0 + $Et * $X - pow($Et, 3) * $XI + pow($Et, 5) * $XII - pow($Et, 7) * $XIIA);
     return $E_N_to_Long;
 }
Example #2
0
 /** Un-project Transverse Mercator eastings and northings back to longitude.
  * @uses marc
  * @uses InitialLat
  * @param string $East easting in metres
  * @param string $North northing in metres
  * @param string $a ellipsoid axis in metres
  * @param string $b ellipsoid axis in metres
  * @param string $e0 eastings false origin
  * @param string $n0 northings false origin
  * @param integer $f0 central meridian scale factor 
  * @param double $PHI0 latitude of false origin in dec degrees
  * @param double $LAM0 longitude of false origin in dec degrees
  */
 private function _eNtoLong($East, $North, $a, $b, $e0, $n0, $f0, $PHI0, $LAM0)
 {
     //Convert angle measures to radians
     $RadPHI0 = $PHI0 * (self::PI / 180);
     $RadLAM0 = $LAM0 * (self::PI / 180);
     //Compute af0, bf0, e squared (e2), n and Et
     $af0 = $a * $f0;
     $bf0 = $b * $f0;
     $e2 = (pow($af0, 2) - pow($bf0, 2)) / pow($af0, 2);
     $n = ($af0 - $bf0) / ($af0 + $bf0);
     $Et = $East - $e0;
     //Compute initial value for latitude (PHI) in radians
     $PHId = $this->_initialLat($North, $n0, $af0, $RadPHI0, $n, $bf0);
     //Compute nu, rho and eta2 using value for PHId
     $nu = $af0 / sqrt(1 - $e2 * pow(sin($PHId), 2));
     $rho = $nu * (1 - $e2) / (1 - $e2 * pow(Sin($PHId), 2));
     $eta2 = $nu / $rho - 1;
     //Compute Longitude
     $X = pow(cos($PHId), -1) / $nu;
     $XI = pow(cos($PHId), -1) / (6 * pow($nu, 3)) * ($nu / $rho + 2 * pow(tan($PHId), 2));
     $XII = pow(cos($PHId), -1) / (120 * pow($nu, 5)) * (5 + 28 * pow(tan($PHId), 2) + 24 * pow(tan($PHId), 4));
     $XIIA = pow(Cos($PHId), -1) / (5040 * pow($nu, 7)) * (61 + 662 * pow(tan($PHId), 2) + 1320 * pow(Tan($PHId), 4) + 720 * pow(tan($PHId), 6));
     $E_N_to_Long = 180 / self::PI * ($RadLAM0 + $Et * $X - pow($Et, 3) * $XI + pow($Et, 5) * $XII - pow($Et, 7) * $XIIA);
     return $E_N_to_Long;
 }