protected CassiniSoldner(ParameterValueGroup values) throws ParameterNotFoundException { super(values); ml0 = mlfn(latitudeOfOrigin, Math.sin(latitudeOfOrigin), Math.cos(latitudeOfOrigin)); }
/** * Transforms the specified (<var>x</var>,<var>y</var>) coordinate and stores the result in * {@code ptDst}. */ protected Point2D inverseTransformNormalized(double x, double y, Point2D ptDst) throws ProjectionException { double ph1 = inv_mlfn(ml0 + y); double tn = Math.tan(ph1); double t = tn * tn; double n = Math.sin(ph1); double r = 1.0 / (1.0 - excentricitySquared * n * n); n = Math.sqrt(r); r *= (1.0 - excentricitySquared) * n; double dd = x / n; double d2 = dd * dd; double phi = ph1 - (n * tn / r) * d2 * (0.5 - (1.0 + 3.0 * t) * d2 * C3); double lam = dd * (1.0 + t * d2 * (-C4 + (1.0 + 3.0 * t) * d2 * C5)) / Math.cos(ph1); if (ptDst != null) { ptDst.setLocation(lam, phi); return ptDst; } return new Point2D.Double(lam, phi); }
/** * Creates a transform from the specified group of parameter values. * * @param parameters The group of parameter values. * @return The created math transform. * @throws ParameterNotFoundException if a required parameter was not found. */ public MathTransform createMathTransform(final ParameterValueGroup parameters) throws ParameterNotFoundException { if (isSpherical(parameters)) { return new Spherical(parameters); } else { return new CassiniSoldner(parameters); } } }
/** * Transforms the specified (<var>x</var>,<var>y</var>) coordinate (units in radians) and stores * the result in {@code ptDst} (linear distance on a unit sphere). */ protected Point2D transformNormalized(double lam, double phi, Point2D ptDst) throws ProjectionException { double sinphi = Math.sin(phi); double cosphi = Math.cos(phi); double n = 1.0 / (Math.sqrt(1.0 - excentricitySquared * sinphi * sinphi)); double tn = Math.tan(phi); double t = tn * tn; double a1 = lam * cosphi; double c = cosphi * cosphi * excentricitySquared / (1 - excentricitySquared); double a2 = a1 * a1; double x = n * a1 * (1.0 - a2 * t * (C1 - (8.0 - t + 8.0 * c) * a2 * C2)); double y = (mlfn(phi, sinphi, cosphi)) - ml0 + n * tn * a2 * (0.5 + (5.0 - t + 6.0 * c) * a2 * C3); if (ptDst != null) { ptDst.setLocation(x, y); return ptDst; } return new Point2D.Double(x, y); }