/** * 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 */ @Override public ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl result) { double fromLat = Math.toRadians(latlon.getLatitude()); double theta = Math.toRadians(latlon.getLongitude()); if (projectionLongitude != 0 && !Double.isNaN(theta)) { theta = MapMath.normalizeLongitude(theta - projectionLongitude); } Point2D.Double out = new Point2D.Double(); out = project(theta, fromLat, out); result.setLocation(totalScale * out.x + falseEasting, totalScale * out.y + falseNorthing); 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 */ @Override public ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl result) { double fromLat = Math.toRadians(latlon.getLatitude()); double theta = Math.toRadians(latlon.getLongitude()); if (projectionLongitude != 0 && !Double.isNaN(theta)) { theta = MapMath.normalizeLongitude(theta - projectionLongitude); } ProjectionPointImpl out = new ProjectionPointImpl(); project(theta, fromLat, out); result.setLocation(totalScale * out.getX() + falseEasting, totalScale * out.getY() + falseNorthing); 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 */ @Override public ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl result) { double fromLat = Math.toRadians(latlon.getLatitude()); double theta = Math.toRadians(latlon.getLongitude()); if (projectionLongitude != 0 && !Double.isNaN(theta)) { theta = MapMath.normalizeLongitude(theta - projectionLongitude); } ProjectionPointImpl out = new ProjectionPointImpl(); project(theta, fromLat, out); result.setLocation(totalScale * out.getX() + falseEasting, totalScale * out.getY() + falseNorthing); return result; }