/** * 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 ms, sp, cp, x, y; if (abs(phi) <= EPSILON) { x = lam; y = -ml0; } else { sp = sin(phi); ms = abs(cp = cos(phi)) > EPSILON ? msfn(sp, cp) / sp : 0.; lam *= sp; x = ms * sin(lam); y = (mlfn(phi, sp, cp) - ml0) + ms * (1. - cos(lam)); } if (ptDst != null) { ptDst.setLocation(x, y); return ptDst; } return new Point2D.Double(x, y); }