lambda -= centralMeridian; } else { // Polar phi = inv_mlfn((mode == Mode.NORTH_POLAR) ? (Mp - c) : (Mp + c)); lambda = atan2(x, (mode == Mode.NORTH_POLAR) ? -y : y);
coslam = -coslam; case SOUTH_POLAR: double rho = abs(Mp - mlfn(phi, sinphi, cosphi)); x = rho * sin(lambda); y = rho * coslam;
/** * Constructor. * * @param parameters the parameters that define this projection * @throws ParameterNotFoundException */ protected Ellipsoidal(ParameterValueGroup parameters) throws ParameterNotFoundException { super(parameters); switch (mode) { case NORTH_POLAR: Mp = mlfn(HALF_PI, 1, 0); geodesic = null; break; case SOUTH_POLAR: Mp = mlfn(-HALF_PI, -1, 0); geodesic = null; break; case EQUATORIAL: case OBLIQUE: Mp = Double.NaN; geodesic = new Geodesic(semiMajor, (semiMajor - semiMinor) / semiMajor); break; default: throw new RuntimeException( "Unexpected mode " + mode + " for ellipsoidal AzimuthalEquidistant projection"); } }
/** * Create an Azimuthal Equidistant projection. * * @return {@link Spherical} or {@link Ellipsoidal} depending on the parameters. * @see * org.geotools.referencing.operation.MathTransformProvider#createMathTransform(org.opengis.parameter.ParameterValueGroup) */ @Override protected MathTransform createMathTransform(ParameterValueGroup parameters) throws InvalidParameterNameException, ParameterNotFoundException, InvalidParameterValueException, FactoryException { if (isSpherical(parameters)) { return new Spherical(parameters); } else { return new Ellipsoidal(parameters); } } }