protected double LLToWorldReturningLon(double lat,double lon,Point2D lp){
  double phi_deg=lat;
  double phi=ProjMath.degToRad(phi_deg);
  double lamba_deg=lon;
  double lamba=ProjMath.degToRad(lamba_deg);
  double dlamda=lamba - lamdaf;
  if (dlamda > Math.PI) {
    dlamda-=MoreMath.TWO_PI_D;
  }
 else   if (dlamda < -Math.PI) {
    dlamda+=MoreMath.TWO_PI_D;
  }
  double e=ellps.ecc;
  double r=0.0d;
  if (!MoreMath.approximately_equal(Math.abs(phi),MoreMath.HALF_PI,EPS10)) {
    double t=lambTsfn(phi,Math.sin(phi),e);
    r=ellps.radius * F * Math.pow(t,n);
  }
  double theta=n * dlamda;
  double easting=falseEasting + r * Math.sin(theta - alpha);
  double northing=falseNorthing + rf - r * Math.cos(theta - alpha);
  lp.setLocation(easting,northing);
  return dlamda;
}

protected double LLToWorldReturningLon ( double lat , double lon , Point2D lp ) { double phi_deg = lat ; double phi = ProjMath . degToRad ( phi_deg ) ; double lamba_deg = lon ; double lamba = ProjMath . degToRad ( lamba_deg ) ; double dlamda = lamba - lamdaf ; if ( dlamda > Math . PI ) { dlamda -= MoreMath . TWO_PI_D ; } else if ( dlamda < - Math . PI ) { dlamda += MoreMath . TWO_PI_D ; } double e = ellps . ecc ; double r = 0.0d ; if ( ! MoreMath . approximately_equal ( Math . abs ( phi ) , MoreMath . HALF_PI , EPS10 ) ) { double t = lambTsfn ( phi , Math . sin ( phi ) , e ) ; r = ellps . radius * F * Math . pow ( t , n ) ; } double theta = n * dlamda ; double easting = falseEasting + r * Math . sin ( theta - alpha ) ; double northing = falseNorthing + rf - r * Math . cos ( theta - alpha ) ; lp . setLocation ( easting , northing ) ; return dlamda ; }
lltoworld that returns normalized longitude in radians , to be used for more calculations in some methods . do not provide a null lp here if you want the world coordinates provided back to you .
