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


    fromX = fromX - false_east;
    fromY = fromY - false_north;
    double rho = Math.sqrt(fromX * fromX + fromY * fromY);
    double r = rho / R;
    double con = P - 1.0;
    double com = P + 1.0;
    double c = Math.asin((P - Math.sqrt(1.0 - (r * r * com) / con))
            / (con / r + r / con));

    toLon = lon0;
    double temp = 0;
    if (Math.abs(rho) > TOLERANCE) {
      toLat = Math.asin(Math.cos(c) * sinLat0
              + (fromY * Math.sin(c) * cosLat0 / rho));
      if (Math.abs(lat0 - PI_OVER_4) > TOLERANCE) {  // not 90 or -90
        temp = rho * cosLat0 * Math.cos(c)
                - fromY * sinLat0 * Math.sin(c);
        toLon = lon0 + Math.atan(fromX * Math.sin(c) / temp);
      } else if (Double.compare(lat0, PI_OVER_4) == 0) {
        toLon = lon0 + Math.atan(fromX / -fromY);
        temp = -fromY;
      } else {
        toLon = lon0 + Math.atan(fromX / fromY);
        temp = fromY;
      }
    } else {
      toLat = lat0;
    }
    toLat = Math.toDegrees(toLat);
    toLon = Math.toDegrees(toLon);
    if (temp < 0) {
      toLon += 180;
    }
    toLon = LatLonPointImpl.lonNormal(toLon);

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


    fromX = fromX - false_east;
    fromY = fromY - false_north;
    double rho = Math.sqrt(fromX * fromX + fromY * fromY);
    double r = rho / R;
    double con = P - 1.0;
    double com = P + 1.0;
    double c = Math.asin((P - Math.sqrt(1.0 - (r * r * com) / con))
            / (con / r + r / con));

    toLon = lon0;
    double temp = 0;
    if (Math.abs(rho) > TOLERANCE) {
      toLat = Math.asin(Math.cos(c) * sinLat0
              + (fromY * Math.sin(c) * cosLat0 / rho));
      if (Math.abs(lat0 - PI_OVER_4) > TOLERANCE) {  // not 90 or -90
        temp = rho * cosLat0 * Math.cos(c)
                - fromY * sinLat0 * Math.sin(c);
        toLon = lon0 + Math.atan(fromX * Math.sin(c) / temp);
      } else if (Double.compare(lat0, PI_OVER_4) == 0) {
        toLon = lon0 + Math.atan(fromX / -fromY);
        temp = -fromY;
      } else {
        toLon = lon0 + Math.atan(fromX / fromY);
        temp = fromY;
      }
    } else {
      toLat = lat0;
    }
    toLat = Math.toDegrees(toLat);
    toLon = Math.toDegrees(toLon);
    if (temp < 0) {
      toLon += 180;
    }
    toLon = LatLonPointImpl.lonNormal(toLon);

    result.setLatitude(toLat);
    result.setLongitude(toLon);
    return result;
  }
public LatLonPoint projToLatLon ( ProjectionPoint world , LatLonPointImpl result ) { double toLat , toLon ; double fromX = world . getX ( ) ; double fromY = world . getY ( ) ; fromX = fromX - false_east ; fromY = fromY - false_north ; double rho = Math . sqrt ( fromX * fromX + fromY * fromY ) ; double r = rho / R ; double con = P - 1.0 ; double com = P + 1.0 ; double c = Math . asin ( ( P - Math . sqrt ( 1.0 - ( r * r * com ) / con ) ) / ( con / r + r / con ) ) ; toLon = lon0 ; double temp = 0 ; if ( Math . abs ( rho ) > TOLERANCE ) { toLat = Math . asin ( Math . cos ( c ) * sinLat0 + ( fromY * Math . sin ( c ) * cosLat0 / rho ) ) ; if ( Math . abs ( lat0 - PI_OVER_4 ) > TOLERANCE ) { // not 90 or -90
 temp = rho * cosLat0 * Math . cos ( c ) - fromY * sinLat0 * Math . sin ( c ) ; toLon = lon0 + Math . atan ( fromX * Math . sin ( c ) / temp ) ; } else if ( Double . compare ( lat0 , PI_OVER_4 ) == 0 ) { toLon = lon0 + Math . atan ( fromX / - fromY ) ; temp = - fromY ; } else { toLon = lon0 + Math . atan ( fromX / fromY ) ; temp = fromY ; } } else { toLat = lat0 ; } toLat = Math . toDegrees ( toLat ) ; toLon = Math . toDegrees ( toLon ) ; if ( temp < 0 ) { toLon += 180 ; } toLon = LatLonPointImpl . lonNormal ( toLon ) ; 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 .