/** * Transforms the specified (<var>x</var>,<var>y</var>) coordinates and stores the result in * {@code lp}. */ protected Point2D inverseTransformNormalized(double x, double y, final Point2D lp) throws ProjectionException { double lam, phi; if (isSpherical) { double t = Math.abs(y *= scaleFactor); // if (t - EPS <= 1.) {//if (true) { //if ((t = fabs(xy.y *= P->k0)) - EPS <= 1.) { if (t >= 1.) { phi = y < 0. ? -HALFPI : HALFPI; } else { phi = Math.asin(y); } lam = x / scaleFactor; } else { phi = ProjectionMath.authlat(Math.asin(2. * y * scaleFactor / qp), apa); lam = x / scaleFactor; } if (lp != null) { lp.setLocation(lam, phi); return lp; } else { return new Point2D.Double(lam, phi); } }
/** * Transforms the specified (<var>λ</var>,<var>φ</var>) coordinates (units in * radians) and stores the result in {@code xy} (linear distance on a unit sphere). */ protected Point2D transformNormalized(double lam, double phi, final Point2D xy) throws ProjectionException { double x, y; if (isSpherical) { x = scaleFactor * lam; y = Math.sin(phi) / scaleFactor; } else { x = scaleFactor * lam; y = .5 * ProjectionMath.qsfn(Math.sin(phi), e, one_es) / scaleFactor; } if (xy != null) { xy.setLocation(x, y); return xy; } else { return new Point2D.Double(x, y); } }
protected CylindricalEqualArea(final ParameterValueGroup parameters) throws ParameterNotFoundException { super(parameters); // Set trueScaleLatitude ("lat_ts" in Proj4) trueScaleLatitude = DTR * parameters.parameter("standard_parallel_1").doubleValue(); es = excentricitySquared; e = excentricity; one_es = 1 - (excentricitySquared); double t = trueScaleLatitude; scaleFactor = Math.cos(t); if (es != 0) { t = Math.sin(t); scaleFactor /= Math.sqrt(1. - es * t * t); e = Math.sqrt(es); // P->e = sqrt(P->es); apa = ProjectionMath.authset(es); qp = ProjectionMath.qsfn(1., e, one_es); } }