/** * Transforms the specified (<var>λ</var>,<var>φ</var>) coordinates (units in * radians) and stores the result in {@code ptDst} (linear distance on a unit sphere). */ protected Point2D transformNormalized(double x, double y, Point2D ptDst) throws ProjectionException { x *= n; double rho; if (isSpherical) { rho = c - n * 2 * sin(y); } else { rho = c - n * qsfn(sin(y)); } if (rho < 0.0) { if (rho > -EPSILON) { rho = 0.0; } else { throw new ProjectionException(ErrorKeys.TOLERANCE_ERROR); } } rho = sqrt(rho) / n; y = rho0 - rho * cos(x); x = rho * sin(x); if (ptDst != null) { ptDst.setLocation(x, y); return ptDst; } return new Point2D.Double(x, y); }