/** * 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 lam, double phi, final Point2D ptDst) throws ProjectionException { double x, y; if (isSpherical) { x = lam * cos(phi); y = phi; } else { double s = sin(phi); double c = cos(phi); y = mlfn(phi, sin(phi), cos(phi)); x = lam * c / sqrt(1. - excentricitySquared * s * s); } if (ptDst != null) { ptDst.setLocation(x, y); return ptDst; } else { return new Point2D.Double(x, y); } }