public ProjectionPoint latLonToProj(LatLonPoint latLon,
                                      ProjectionPointImpl result) {
    double toX, toY;
    double fromLat = latLon.getLatitude();
    double fromLon = latLon.getLongitude();


    fromLat = Math.toRadians(fromLat);
    double lonDiff = Math.toRadians(LatLonPointImpl.lonNormal(fromLon
            - lon0Degrees));
    double g = sinLat0 * Math.sin(fromLat)
            + cosLat0 * Math.cos(fromLat) * Math.cos(lonDiff);

    double kPrime = Math.sqrt(2 / (1 + g));
    toX = R * kPrime * Math.cos(fromLat) * Math.sin(lonDiff)
            + falseEasting;
    toY = R * kPrime
            * (cosLat0 * Math.sin(fromLat)
            - sinLat0 * Math.cos(fromLat)
            * Math.cos(lonDiff)) + falseNorthing;

    result.setLocation(toX, toY);
    return result;
  }
public ProjectionPoint latLonToProj(LatLonPoint latLon,
                                      ProjectionPointImpl result) {
    double toX, toY;
    double fromLat = latLon.getLatitude();
    double fromLon = latLon.getLongitude();


    fromLat = Math.toRadians(fromLat);
    double lonDiff = Math.toRadians(LatLonPointImpl.lonNormal(fromLon
            - lon0Degrees));
    double g = sinLat0 * Math.sin(fromLat)
            + cosLat0 * Math.cos(fromLat) * Math.cos(lonDiff);

    double kPrime = Math.sqrt(2 / (1 + g));
    toX = R * kPrime * Math.cos(fromLat) * Math.sin(lonDiff)
            + falseEasting;
    toY = R * kPrime
            * (cosLat0 * Math.sin(fromLat)
            - sinLat0 * Math.cos(fromLat)
            * Math.cos(lonDiff)) + falseNorthing;

    result.setLocation(toX, toY);
    return result;
  }
public ProjectionPoint latLonToProj ( LatLonPoint latLon , ProjectionPointImpl result ) { double toX , toY ; double fromLat = latLon . getLatitude ( ) ; double fromLon = latLon . getLongitude ( ) ; fromLat = Math . toRadians ( fromLat ) ; double lonDiff = Math . toRadians ( LatLonPointImpl . lonNormal ( fromLon - lon0Degrees ) ) ; double g = sinLat0 * Math . sin ( fromLat ) + cosLat0 * Math . cos ( fromLat ) * Math . cos ( lonDiff ) ; double kPrime = Math . sqrt ( 2 / ( 1 + g ) ) ; toX = R * kPrime * Math . cos ( fromLat ) * Math . sin ( lonDiff ) + falseEasting ; toY = R * kPrime * ( cosLat0 * Math . sin ( fromLat ) - sinLat0 * Math . cos ( fromLat ) * Math . cos ( lonDiff ) ) + falseNorthing ; result . setLocation ( toX , toY ) ; return result ; }
Convert a LatLonPoint to projection coordinates

@param latLon convert from these lat, lon coordinates
@param result the object to write to
@return the given result
Convert a LatLonPoint to projection coordinates