public LatLonPoint toLatLonPoint(boolean southernHemisphere){
  LatLonPoint llp=new LatLonPoint.Double();
  double lon=0;
  double lat=0;
  double a=0;
  double es=0;
  double e=0;
  double t=0;
  double rho=0;
  double x=easting;
  double y=northing;
  final double k0=0.994;
  a=6378137.0;
  es=0.00669438d;
  e=Math.sqrt(es);
  x-=2.0e6;
  y-=2.0e6;
  rho=Math.sqrt(x * x + y * y);
  t=rho * Math.sqrt(Math.pow(1.0 + e,1.0 + e) * Math.pow(1.0 - e,1.0 - e)) / (2.0 * a * k0);
  lat=calcPhi(e,t);
  lat/=Degree;
  if (y != 0.0) {
    t=Math.atan(Math.abs(x / y));
  }
 else {
    t=Math.PI / 2.0;
    if (x < 0.0) {
      t=-t;
    }
  }
  if (southernHemisphere == false) {
    y=-y;
  }
 else {
    lat=-lat;
  }
  if (y < 0.0) {
    t=Math.PI - t;
  }
  if (x < 0.0) {
    t=-t;
  }
  lon=t / Degree;
  llp.setLatitude((float)lat);
  llp.setLongitude((float)lon);
  return llp;
}

public LatLonPoint toLatLonPoint ( boolean southernHemisphere ) { LatLonPoint llp = new LatLonPoint . Double ( ) ; double lon = 0 ; double lat = 0 ; double a = 0 ; double es = 0 ; double e = 0 ; double t = 0 ; double rho = 0 ; double x = easting ; double y = northing ; final double k0 = 0.994 ; a = 6378137.0 ; es = 0.00669438d ; e = Math . sqrt ( es ) ; x -= 2.0e6 ; y -= 2.0e6 ; rho = Math . sqrt ( x * x + y * y ) ; t = rho * Math . sqrt ( Math . pow ( 1.0 + e , 1.0 + e ) * Math . pow ( 1.0 - e , 1.0 - e ) ) / ( 2.0 * a * k0 ) ; lat = calcPhi ( e , t ) ; lat /= Degree ; if ( y != 0.0 ) { t = Math . atan ( Math . abs ( x / y ) ) ; } else { t = Math . PI / 2.0 ; if ( x < 0.0 ) { t = - t ; } } if ( southernHemisphere == false ) { y = - y ; } else { lat = - lat ; } if ( y < 0.0 ) { t = Math . PI - t ; } if ( x < 0.0 ) { t = - t ; } lon = t / Degree ; llp . setLatitude ( ( float ) lat ) ; llp . setLongitude ( ( float ) lon ) ; return llp ; }
convert a upspoint to a latlonpoint
