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

    double rho = Math.sqrt(fromX * fromX + fromY * fromY);
    double c = 2.0 * Math.atan2(rho, 2.0 * scale);
    double sinc = Math.sin(c);
    double cosc = Math.cos(c);

    if (Math.abs(rho) < TOLERANCE) {
      phi = latt;
    } else {
      phi = Math.asin(cosc * sinlatt + fromY * sinc * coslatt / rho);
    }

    toLat = Math.toDegrees(phi);

    if ((Math.abs(fromX) < TOLERANCE) && (Math.abs(fromY) < TOLERANCE)) {
      lam = lont;
    } else if (Math.abs(coslatt) < TOLERANCE) {
      lam = lont + Math.atan2(fromX, ((latt > 0)
              ? -fromY
              : fromY));
    } else {
      lam = lont + Math.atan2(fromX * sinc, rho * coslatt * cosc - fromY * sinc * sinlatt);
    }

    toLon = Math.toDegrees(lam);

    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 phi, lam;

    double rho = Math.sqrt(fromX * fromX + fromY * fromY);
    double c = 2.0 * Math.atan2(rho, 2.0 * scale);
    double sinc = Math.sin(c);
    double cosc = Math.cos(c);

    if (Math.abs(rho) < TOLERANCE) {
      phi = latt;
    } else {
      phi = Math.asin(cosc * sinlatt + fromY * sinc * coslatt / rho);
    }

    toLat = Math.toDegrees(phi);

    if ((Math.abs(fromX) < TOLERANCE) && (Math.abs(fromY) < TOLERANCE)) {
      lam = lont;
    } else if (Math.abs(coslatt) < TOLERANCE) {
      lam = lont + Math.atan2(fromX, ((latt > 0)
              ? -fromY
              : fromY));
    } else {
      lam = lont + Math.atan2(fromX * sinc, rho * coslatt * cosc - fromY * sinc * sinlatt);
    }

    toLon = Math.toDegrees(lam);

    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 phi , lam ; double rho = Math . sqrt ( fromX * fromX + fromY * fromY ) ; double c = 2.0 * Math . atan2 ( rho , 2.0 * scale ) ; double sinc = Math . sin ( c ) ; double cosc = Math . cos ( c ) ; if ( Math . abs ( rho ) < TOLERANCE ) { phi = latt ; } else { phi = Math . asin ( cosc * sinlatt + fromY * sinc * coslatt / rho ) ; } toLat = Math . toDegrees ( phi ) ; if ( ( Math . abs ( fromX ) < TOLERANCE ) && ( Math . abs ( fromY ) < TOLERANCE ) ) { lam = lont ; } else if ( Math . abs ( coslatt ) < TOLERANCE ) { lam = lont + Math . atan2 ( fromX , ( ( latt > 0 ) ? - fromY : fromY ) ) ; } else { lam = lont + Math . atan2 ( fromX * sinc , rho * coslatt * cosc - fromY * sinc * sinlatt ) ; } toLon = Math . toDegrees ( lam ) ; 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 .