cdm/src/main/java/ucar/unidata/geoloc/projection/LambertConformal.java
public LatLonPoint projToLatLon(ProjectionPoint world,
                                  LatLonPointImpl result) {
    double toLat, toLon;
    double fromX = world.getX() - falseEasting;
    double fromY = world.getY() - falseNorthing;
    double rhop = rho;

    if (n < 0) {
      rhop *= -1.0;
      fromX *= -1.0;
      fromY *= -1.0;
    }

    double yd = (rhop - fromY);
    double theta = Math.atan2(fromX, yd);
    double r = Math.sqrt(fromX * fromX + yd * yd);
    if (n < 0.0) {
      r *= -1.0;
    }

    toLon = (Math.toDegrees(theta / n + lon0));

    if (Math.abs(r) < TOLERANCE) {
      toLat = ((n < 0.0)
              ? -90.0
              : 90.0);
    } else {
      double rn = Math.pow(earth_radius * F / r, 1 / n);
      toLat = Math.toDegrees(2.0 * Math.atan(rn) - Math.PI / 2);
    }

    result.setLatitude(toLat);
    result.setLongitude(toLon);
    return result;
  }
public LatLonPoint projToLatLon(ProjectionPoint world,
                                  LatLonPointImpl result) {
    double toLat, toLon;
    double fromX = world.getX() - falseEasting;
    double fromY = world.getY() - falseNorthing;
    double rhop = rho;

    if (n < 0) {
      rhop *= -1.0;
      fromX *= -1.0;
      fromY *= -1.0;
    }

    double yd = (rhop - fromY);
    double theta = Math.atan2(fromX, yd);
    double r = Math.sqrt(fromX * fromX + yd * yd);
    if (n < 0.0) {
      r *= -1.0;
    }

    toLon = (Math.toDegrees(theta / n + lon0));

    if (Math.abs(r) < TOLERANCE) {
      toLat = ((n < 0.0)
              ? -90.0
              : 90.0);
    } else {
      double rn = Math.pow(earth_radius * F / r, 1 / n);
      toLat = Math.toDegrees(2.0 * Math.atan(rn) - Math.PI / 2);
    }

    result.setLatitude(toLat);
    result.setLongitude(toLon);
    return result;
  }
public LatLonPoint projToLatLon ( ProjectionPoint world , LatLonPointImpl result ) { double toLat , toLon ; double fromX = world . getX ( ) - falseEasting ; double fromY = world . getY ( ) - falseNorthing ; double rhop = rho ; if ( n < 0 ) { rhop *= - 1.0 ; fromX *= - 1.0 ; fromY *= - 1.0 ; } double yd = ( rhop - fromY ) ; double theta = Math . atan2 ( fromX , yd ) ; double r = Math . sqrt ( fromX * fromX + yd * yd ) ; if ( n < 0.0 ) { r *= - 1.0 ; } toLon = ( Math . toDegrees ( theta / n + lon0 ) ) ; if ( Math . abs ( r ) < TOLERANCE ) { toLat = ( ( n < 0.0 ) ? - 90.0 : 90.0 ) ; } else { double rn = Math . pow ( earth_radius * F / r , 1 / n ) ; toLat = Math . toDegrees ( 2.0 * Math . atan ( rn ) - Math . PI / 2 ) ; } result . setLatitude ( toLat ) ; result . setLongitude ( toLon ) ; return result ; }
Convert projection coordinates to a LatLonPoint
Note: a new object is not created on each call for the return value.

@param world  convert from these projection coordinates
@param result the object to write to
@return LatLonPoint convert to these lat/lon coordinates
Convert projection coordinates to a LatLonPoint Note : a new object is not created on each call for the return value .