/** * Worker method to be overridden by derived class. Performs the pure transformation. Prescaling, northing, * easting etc is calculated in this class. * * @param lat latitude of source location * @param lon longitude of source location * @param mapPoint * * @return the map co-ordinate */ @Override protected Point2D forward_impl(float lat, float lon, Point2D mapPoint) { final double phi = MathUtils.DTOR * lat; double lam = MathUtils.DTOR * lon; double rho; if (Math.abs(Math.abs(phi) - MathUtils.HALFPI) < _epsilon) { if ((phi * _n) < 0.0) { throw new IllegalArgumentException("Invalid parameter range"); } rho = 0.0; } else { double temp = MapTransformUtils.tsfn(phi, Math.sin(phi), _e); rho = _c * Math.pow(temp, _n); } lam = lam * _n; double tempX = _k0 * (rho * Math.sin(lam)); double tempY = _k0 * (_rho0 - rho * Math.cos(lam)); mapPoint.setLocation(tempX, tempY); return mapPoint; }
_e = Math.sqrt(es); double m1 = MapTransformUtils.msfn(sinPhi, cosPhi, es); double ml1 = MapTransformUtils.tsfn(phi1, sinPhi, _e); temp = MapTransformUtils.tsfn(phi2, Math.sin(phi2), _e); _n = _n / Math.log(ml1 / temp); temp = MapTransformUtils.tsfn(phi0, Math.sin(phi0), _e); _rho0 = _c * Math.pow(temp, _n);
out = MapTransformUtils.tsfn(phi[n], sinPhi[n], e[n]); assertEquals(result[n], out, 1e-6);