/** * Precalculate some stuff */ private void precalculate() { double par1r = Math.toRadians(this.par1); double par2r = Math.toRadians(this.par2); if (Math.abs(par2 - par1) < TOLERANCE) { // single parallel n = Math.sin(par1r); } else { n = (Math.sin(par1r) + Math.sin(par2r)) / 2.0; } double c2 = Math.pow(Math.cos(par1r), 2); C = c2 + 2 * n * Math.sin(par1r); rho0 = computeRho(lat0); }
/** * Precalculate some stuff */ private void precalculate() { double par1r = Math.toRadians(this.par1); double par2r = Math.toRadians(this.par2); if (Math.abs(par2 - par1) < TOLERANCE) { // single parallel n = Math.sin(par1r); } else { n = (Math.sin(par1r) + Math.sin(par2r)) / 2.0; } double c2 = Math.pow(Math.cos(par1r), 2); C = c2 + 2 * n * Math.sin(par1r); rho0 = computeRho(lat0); }
/** * Precalculate some stuff */ private void precalculate() { double par1r = Math.toRadians(this.par1); double par2r = Math.toRadians(this.par2); if (Math.abs(par2 - par1) < TOLERANCE) { // single parallel n = Math.sin(par1r); } else { n = (Math.sin(par1r) + Math.sin(par2r)) / 2.0; } double c2 = Math.pow(Math.cos(par1r), 2); C = c2 + 2 * n * Math.sin(par1r); rho0 = computeRho(lat0); }
/** * Precalculate some stuff */ private void precalculate() { double par1r = Math.toRadians(this.par1); double par2r = Math.toRadians(this.par2); if (Math.abs(par2 - par1) < TOLERANCE) { // single parallel n = Math.sin(par1r); } else { n = (Math.sin(par1r) + Math.sin(par2r)) / 2.0; } double c2 = Math.pow(Math.cos(par1r), 2); C = c2 + 2 * n * Math.sin(par1r); rho0 = computeRho(lat0); }
double rho = computeRho(fromLat); double theta = computeTheta(fromLon);
double rho = computeRho(fromLat); double theta = computeTheta(fromLon);
double rho = computeRho(fromLat); double theta = computeTheta(fromLon);
double rho = computeRho(fromLat); double theta = computeTheta(fromLon);
double rho = computeRho(fromLat); double theta = computeTheta(fromLon);
double rho = computeRho(fromLat); double theta = computeTheta(fromLon);
double rho = computeRho(fromLat); double theta = computeTheta(fromLon);
double rho = computeRho(fromLat); double theta = computeTheta(fromLon);
/** * 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 */ public ProjectionPoint latLonToProj(LatLonPoint latLon, ProjectionPointImpl result) { double toX, toY; double fromLat = latLon.getLatitude(); double fromLon = latLon.getLongitude(); fromLat = Math.toRadians(fromLat); fromLon = Math.toRadians(fromLon); double rho = computeRho(fromLat); double theta = computeTheta(fromLon); toX = rho * Math.sin(theta) + falseEasting; toY = rho0 - rho * Math.cos(theta) + 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 */ public ProjectionPoint latLonToProj(LatLonPoint latLon, ProjectionPointImpl result) { double toX, toY; double fromLat = latLon.getLatitude(); double fromLon = latLon.getLongitude(); fromLat = Math.toRadians(fromLat); fromLon = Math.toRadians(fromLon); double rho = computeRho(fromLat); double theta = computeTheta(fromLon); toX = rho * Math.sin(theta) + falseEasting; toY = rho0 - rho * Math.cos(theta) + 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 */ public ProjectionPoint latLonToProj(LatLonPoint latLon, ProjectionPointImpl result) { double toX, toY; double fromLat = latLon.getLatitude(); double fromLon = latLon.getLongitude(); fromLat = Math.toRadians(fromLat); fromLon = Math.toRadians(fromLon); double rho = computeRho(fromLat); double theta = computeTheta(fromLon); toX = rho * Math.sin(theta) + falseEasting; toY = rho0 - rho * Math.cos(theta) + 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 */ public ProjectionPoint latLonToProj(LatLonPoint latLon, ProjectionPointImpl result) { double toX, toY; double fromLat = latLon.getLatitude(); double fromLon = latLon.getLongitude(); fromLat = Math.toRadians(fromLat); fromLon = Math.toRadians(fromLon); double rho = computeRho(fromLat); double theta = computeTheta(fromLon); toX = rho * Math.sin(theta) + falseEasting; toY = rho0 - rho * Math.cos(theta) + falseNorthing; result.setLocation(toX, toY); return result; }