sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1709443 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/referencing/operation/projection/ test/java/org/apache/sis/referencing/operation/projection/
Date Mon, 19 Oct 2015 16:18:32 GMT
Author: desruisseaux
Date: Mon Oct 19 16:18:31 2015
New Revision: 1709443

URL: http://svn.apache.org/viewvc?rev=1709443&view=rev
Log:
Simplification of some ObliqueStereographic equations.
Attempt to provide more uniformity in projection code formatting.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/LambertConicConformalTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java?rev=1709443&r1=1709442&r2=1709443&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java [UTF-8] Mon Oct 19 16:18:31 2015
@@ -305,10 +305,9 @@ final class Initializer {
     }
 
     /**
-     * Returns the radius of the conformal sphere at a given latitude.
-     * The radius of conformal sphere is computed from ρ, which is the radius of curvature in
-     * the meridian at latitude φ, and ν which is the radius of curvature in the prime vertical,
-     * as below:
+     * Returns the radius of the conformal sphere (assuming a semi-major axis length of 1) at a given latitude.
+     * The radius of conformal sphere is computed from ρ, which is the radius of curvature in the meridian at
+     * latitude φ, and ν which is the radius of curvature in the prime vertical, as below:
      *
      * <blockquote>Rc = √(ρ⋅ν) = √(1 – ℯ²) / (1 – ℯ²sin²φ)</blockquote>
      *

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java?rev=1709443&r1=1709442&r2=1709443&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java [UTF-8] Mon Oct 19 16:18:31 2015
@@ -353,7 +353,7 @@ public class LambertConicConformal exten
      * comparing two {@code LambertConicConformal} projections or formatting them in debug mode.
      */
     @Override
-    String[] getInternalParameterNames() {
+    final String[] getInternalParameterNames() {
         return new String[] {"n"};
     }
 
@@ -362,7 +362,7 @@ public class LambertConicConformal exten
      * comparing two {@code LambertConicConformal} projections or formatting them in debug mode.
      */
     @Override
-    double[] getInternalParameterValues() {
+    final double[] getInternalParameterValues() {
         return new double[] {n};
     }
 
@@ -405,7 +405,7 @@ public class LambertConicConformal exten
          * the first non-linear one moved to the "normalize" affine transform, and the linear operations
          * applied after the last non-linear one moved to the "denormalize" affine transform.
          */
-        final double θ    = srcPts[srcOff  ];     // θ = λ⋅n
+        final double θ    = srcPts[srcOff  ];     // θ = λ⋅n  (ignoring longitude of origin)
         final double φ    = srcPts[srcOff+1];     // Sign may be reversed
         final double absφ = abs(φ);
         final double sinθ = sin(θ);
@@ -430,9 +430,9 @@ public class LambertConicConformal exten
         if (!derivate) {
             return null;
         }
-        //
-        // End of map projection. Now compute the derivative.
-        //
+        /*
+         * End of map projection. Now compute the derivative.
+         */
         final double dρ;
         if (sinφ != 1) {
             dρ = n * dy_dφ(sinφ, cos(φ)) * ρ;
@@ -444,7 +444,7 @@ public class LambertConicConformal exten
     }
 
     /**
-     * Transforms the specified (<var>x</var>,<var>y</var>) coordinates and stores the (θ,φ) result in {@code dstPts}.
+     * Converts the specified (<var>x</var>,<var>y</var>) coordinates and stores the (θ,φ) result in {@code dstPts}.
      *
      * @throws ProjectionException if the point can not be converted.
      */

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java?rev=1709443&r1=1709442&r2=1709443&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java [UTF-8] Mon Oct 19 16:18:31 2015
@@ -404,7 +404,7 @@ public class Mercator extends ConformalP
     }
 
     /**
-     * Transforms the specified (<var>x</var>,<var>y</var>) coordinates
+     * Converts the specified (<var>x</var>,<var>y</var>) coordinates
      * and stores the result in {@code dstPts} (angles in radians).
      *
      * @throws ProjectionException if the point can not be converted.

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java?rev=1709443&r1=1709442&r2=1709443&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java [UTF-8] Mon Oct 19 16:18:31 2015
@@ -23,7 +23,6 @@ import org.opengis.referencing.operation
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.MathTransformFactory;
 import org.opengis.util.FactoryException;
-
 import org.apache.sis.parameter.Parameters;
 import org.apache.sis.util.Workaround;
 import org.apache.sis.referencing.operation.matrix.Matrix2;
@@ -36,12 +35,23 @@ import static org.apache.sis.internal.re
 
 /**
  * <cite>Oblique Stereographic</cite> projection (EPSG code 9809).
- * The formulas used below are from the EPSG guide.
+ * See the <a href="http://mathworld.wolfram.com/StereographicProjection.html">Stereographic projection
+ * on MathWorld</a> for an overview.
+ *
+ * <div class="section">Description</div>
+ * The directions starting from the central point are true, but the areas and the lengths become
+ * increasingly deformed as one moves away from the center. This projection is frequently used
+ * for mapping polar areas, but can also be used for other limited areas centered on a point.
  *
- * <div class="section">References</div>
- * <ul>
- *   <li><a href = http://www.iogp.org/pubs/373-07-2.pdf>EPSG guide</a>.</li>
- * </ul>
+ * <p>This projection involves two steps: first a conversion of <em>geodetic</em> coordinates to <em>conformal</em>
+ * coordinates (i.e. latitudes and longitudes on a conformal sphere), then a spherical stereographic projection.
+ * For this reason this projection method is sometime known as <cite>"Double Stereographic"</cite>.</p>
+ *
+ * <div class="note"><b>Note:</b>
+ * there is another method known as <cite>"Oblique Stereographic Alternative"</cite> or sometime just
+ * <cite>"Stereographic"</cite>. That alternative uses a simplified conversion computing the conformal latitude
+ * of each point on the ellipsoid. Both methods are considered valid but produce slightly different results.
+ * For this reason EPSG considers them as different projection methods.</div>
  *
  * @author  Rémi Maréchal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
@@ -56,73 +66,32 @@ public class ObliqueStereographic extend
     private static final long serialVersionUID = -1454098847621943639L;
 
     /**
-     * Maximum difference allowed when comparing real numbers.
-     */
-    static final double EPSILON = 1E-6;
-
-    /**
-     * Conformal latitude of origin only use
-     * into {@link #inverseTransform(double[], int, double[], int) }.
-     */
-    final double χ0;
-
-    /**
-     * Value of sin(χ0) only use
-     * into {@link #transform(double[], int, double[], int, boolean)  }.
-     *
-     * @see #χ0
-     */
-    final double sinχ0;
-
-    /**
-     * Value of cos(χ0) only use
-     * into {@link #transform(double[], int, double[], int, boolean)  }.
-     *
-     * @see #χ0
-     */
-    final double cosχ0;
-
-    /**
-     * c, internaly parameter used to define conformal sphere, used
-     * into {@link #transform(double[], int, double[], int, boolean)  }
-     * and {@link #inverseTransform(double[], int, double[], int) }.
-     */
-    private final double c;
-
-    /**
-     * n, internaly parameter used to define conformal sphere, used
-     * into {@link #transform(double[], int, double[], int, boolean)  }
-     * and {@link #inverseTransform(double[], int, double[], int) }.
+     * Conformal latitude of origin (χ₀), together with its sine and cosine.
+     * In the spherical case, χ₀ = φ₀ (the geodetic latitude of origin).
      */
-    private final double n;
+    final double χ0, sinχ0, cosχ0;
 
     /**
-     * g, internaly parameter used to define conformal sphere coordinate conversion,
-     * during {@link #inverseTransform(double[], int, double[], int) }.
-     * More precisely g is used to compute i and j parameters and i and j,
-     * are used to compute only conformal longitude.
+     * Parameters used in the conformal sphere definition. Those parameters are used in both the
+     * {@linkplain #transform(double[], int, double[], int, boolean) forward} and
+     * {@linkplain #inverseTransform(double[], int, double[], int) inverse} projection.
+     * If the user-supplied ellipsoid is already a sphere, then those parameters are equal to 1.
      */
-    private final double g;
+    private final double c, n;
 
     /**
-     * h, internaly parameter used to define conformal sphere coordinate conversion,
-     * during {@link #inverseTransform(double[], int, double[], int) }.
-     * More precisely h is used to compute i and j parameters and i and j,
-     * are used to compute only conformal longitude.
+     * Parameters used in the {@linkplain #inverseTransform(double[], int, double[], int) inverse} projection.
+     * More precisely <var>g</var> and <var>h</var> are used to compute intermediate parameters <var>i</var>
+     * and <var>j</var>, which are themselves used to compute conformal latitude and longitude.
      */
-    private final double h;
+    private final double g, h;
 
     /**
-     * A convenient computing for 1 - {@link #excentricitySquared}.
-     */
-    private final double eS1;
-
-    /**
-     * Creates a Oblique Stereographic projection from the given parameters.
+     * Creates an Oblique Stereographic projection from the given parameters.
      * The {@code method} argument can be the description of one of the following:
      *
      * <ul>
-     *   <li><cite>"Oblique Stereographic"</cite>.</li>
+     *   <li><cite>"Oblique Stereographic"</cite>, also known as <cite>"Roussilhe"</cite>.</li>
      * </ul>
      *
      * @param method     Description of the projection parameters.
@@ -152,47 +121,52 @@ public class ObliqueStereographic extend
      */
     private ObliqueStereographic(final Initializer initializer) {
         super(initializer);
-
-        eS1 = 1 - excentricitySquared;
-
-        final double φ0 = toRadians(initializer.getAndStore(LATITUDE_OF_ORIGIN));
-
+        final double φ0      = toRadians(initializer.getAndStore(LATITUDE_OF_ORIGIN));
+        final double sinφ0   = sin(φ0);
         final double cosφ0   = cos(φ0);
         final double cos4_φ0 = pow(cosφ0, 4);
-        n = sqrt((1 + ((excentricitySquared * cos4_φ0) / eS1)));
-
-        final double sinφ0  = sin(φ0);
-        final double esinφ0 = excentricity * sinφ0;
-
-        final double s1 = (1 +  sinφ0) / (1 -  sinφ0);
-        final double s2 = (1 - esinφ0) / (1 + esinφ0);
-        final double w1 = pow(s1 * pow(s2, excentricity), n);
-
+        final double ℯsinφ0  = excentricity * sinφ0;
+        n = sqrt(1 + ((excentricitySquared * cos4_φ0) / (1 - excentricitySquared)));
         /*
-         * Original formula : sinχ0 = ...
-         * To avoid confusion with χ0 conformal latitude of origin,
-         * renamed sinχ0 into sinχc.
+         * Following variables use upper-case because they are written that way in the EPSG guide.
+         */
+        final double S1 = (1 +  sinφ0) / (1 -  sinφ0);
+        final double S2 = (1 - ℯsinφ0) / (1 + ℯsinφ0);
+        final double w1 = pow(S1 * pow(S2, excentricity), n);
+        /*
+         * The χ₁ variable below was named χ₀ in the EPSG guide. We use the χ₁ name in order to avoid confusion with
+         * the conformal latitude of origin, which is also named χ₀ in the EPSG guide. Mathematically, χ₀ and χ₁ are
+         * computed in the same way except that χ₁ is computed with w₁ and χ₀ is computed with w₀.
+         */
+        final double sinχ1 = (w1 - 1) / (w1 + 1);
+        c = ((n + sinφ0) * (1 - sinχ1)) /
+            ((n - sinφ0) * (1 + sinχ1));
+        /*
+         * Convert the geodetic latitude of origin φ₀ to the conformal latitude of origin χ₀.
          */
-        final double sinχc = (w1 - 1) / (w1 + 1);
-        c = (n + sinφ0) * (1 - sinχc) / ((n - sinφ0) * (1 + sinχc));
-
-        //-- for invert formula
         final double w2 = c * w1;
-        χ0 = asin((w2 - 1) / (w2 + 1));
-
-        sinχ0 = sin(χ0);
+        sinχ0 = (w2 - 1) / (w2 + 1);
+        χ0    = asin(sinχ0);
         cosχ0 = cos(χ0);
-
-        final double R = initializer.radiusOfConformalSphere(sinφ0);
-
-        g = tan(PI / 4 - χ0 / 2);
-        h = 2 * tan(χ0) + g;
-
+        /*
+         * Following variables are used only by the inverse projection.
+         */
+        g = tan(PI/4 - χ0/2);
+        h = 2*tan(χ0) + g;
+        /*
+         * One of the first steps performed by the stereographic projection is to multiply the longitude by n.
+         * Since this is a linear operation, we can combine it with other linear operations performed by the
+         * normalization matrix.
+         */
         final MatrixSIS normalize   = context.getMatrix(true);
         final MatrixSIS denormalize = context.getMatrix(false);
         normalize.convertAfter(0, n, null);
-
-        final double R2 = 2 * R;
+        /*
+         * One of the last steps performed by the stereographic projection is to multiply the easting and northing
+         * by 2 times the radius of the conformal sphere. Since this is a linear operation, we combine it with other
+         * linear operations performed by the denormalization matrix.
+         */
+        final double R2 = 2 * initializer.radiusOfConformalSphere(sinφ0);
         denormalize.convertBefore(0, R2, null);
         denormalize.convertBefore(1, R2, null);
     }
@@ -209,7 +183,28 @@ public class ObliqueStereographic extend
         n     = other.n;
         g     = other.g;
         h     = other.h;
-        eS1   = other.eS1;
+    }
+
+    /**
+     * Returns the names of additional internal parameters which need to be taken in account when
+     * comparing two {@code ObliqueStereographic} projections or formatting them in debug mode.
+     *
+     * <p>We could report any of the internal parameters. But since they are all derived from φ₀ and
+     * the {@linkplain #excentricity excentricity} and since the excentricity is already reported by
+     * the super-class, we report only χ₀ is a representative of the internal parameters.</p>
+     */
+    @Override
+    final String[] getInternalParameterNames() {
+        return new String[] {"χ₀"};
+    }
+
+    /**
+     * Returns the values of additional internal parameters which need to be taken in account when
+     * comparing two {@code ObliqueStereographic} projections or formatting them in debug mode.
+     */
+    @Override
+    final double[] getInternalParameterValues() {
+        return new double[] {χ0};
     }
 
     /**
@@ -228,7 +223,7 @@ public class ObliqueStereographic extend
     public MathTransform createMapProjection(final MathTransformFactory factory) throws FactoryException {
         ObliqueStereographic kernel = this;
         if (excentricity == 0) {
-            kernel = new Spherical(this);     // not implemented yet
+            kernel = new Spherical(this);
         }
         return context.completeTransform(factory, kernel);
     }
@@ -242,154 +237,133 @@ public class ObliqueStereographic extend
      * @throws ProjectionException if the coordinate can not be converted.
      */
     @Override
-    public Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) throws ProjectionException {
-        final double φ = srcPts[srcOff + 1];
-        final double λ = srcPts[srcOff];
-
-        final double sinφ      = sin(φ);
-        final double esinφ     = excentricity * sinφ;
-        final double v1_sinφ   = 1 - sinφ;
-        final double v1esinφ   = 1 + esinφ;
-        final double Sa        = (1 + sinφ)  / v1_sinφ;
-        final double Sb        = (1 - esinφ) / v1esinφ;
-        final double sbpowex   = pow(Sb, excentricity);
-        final double sasbpowex = Sa * sbpowex;
-        final double w         = c * pow(sasbpowex, n);
-        final double w1        = w + 1;
-        final double w1_w1     = (w - 1) / w1;
+    public Matrix transform(final double[] srcPts, final int srcOff,
+                            final double[] dstPts, final int dstOff,
+                            final boolean derivate) throws ProjectionException
+    {
+        final double Λ     = srcPts[srcOff  ];      // Λ = λ⋅n  (see below), ignoring longitude of origin.
+        final double φ     = srcPts[srcOff+1];
+        final double sinφ  = sin(φ);
+        final double ℯsinφ = excentricity * sinφ;
+        final double Sa    = (1 +  sinφ) / (1 -  sinφ);
+        final double Sb    = (1 - ℯsinφ) / (1 + ℯsinφ);
+        final double w     = c * pow(Sa * pow(Sb, excentricity), n);
         /*
-         * Sometimes to compute projection coordinates values, computing pass by a
-         * "conformal sphere" to approximate as better, destination projection coordinates.
+         * Convert the geodetic coordinates (φ,λ) to conformal coordinates (χ,Λ) before to apply the
+         * actual stereographic projection.  The geodetic and conformal coordinates will be the same
+         * if the ellipsoid is already a sphere.
          */
-        //-- latitude coordinate into conformal sphere space.
-        final double χ    = asin(w1_w1);
+        final double χ    = asin((w - 1) / (w + 1));
         final double cosχ = cos(χ);
         final double sinχ = sin(χ);
         /*
-         * Longitude coordinate into conformal sphere space is Λ = n(λ–ΛO)+ ΛO.
-         * But in our case, all of this linears computing are delegate into
-         * normalize matrix. See contructor for more precisions.
-         * We work directly with λ.
+         * The conformal longitude is  Λ = n⋅(λ - λ₀) + Λ₀  where λ is the geodetic longitude.
+         * But in Apache SIS implementation, the multiplication by  n  has been merged in the
+         * constructor with other linear operations performed by the "normalization" matrix.
+         * Consequently the value obtained at srcPts[srcOff] is already Λ - Λ₀, not λ - λ₀.
          */
-        final double cosλ = cos(λ);
-        final double sinλ = sin(λ);
+        final double cosΛ = cos(Λ);
+        final double sinΛ = sin(Λ);
         /*
-         * Now transform conformal sphere coordinates
-         * into projection destination space
+         * Now apply the stereographic projection on the conformal sphere using the (χ,Λ) coordinates.
+         * Note that the formulas below are the same than the formulas in the Spherical inner class.
+         * The only significant difference is that the spherical case does not contain all the above
+         * code which converted (φ,λ) into (χ,Λ).
          */
         final double sinχsinχ0 = sinχ * sinχ0;
         final double cosχcosχ0 = cosχ * cosχ0;
-        final double cosχsinλ  = cosχ * sinλ;
-
-        /*
-         * Moreover to convert conformal sphere coordinates into projection destination space,
-         * we retrieve same formula into spherical transformation case.
-         */
-        final double B = 1 + sinχsinχ0 + cosχcosχ0 * cosλ;
-
-        final double y = (sinχ * cosχ0 - cosχ * sinχ0 * cosλ) / B;
-        final double x =  cosχsinλ / B;
-
+        final double B = 1 + sinχsinχ0 + cosχcosχ0 * cosΛ;
         if (dstPts != null) {
-            dstPts[dstOff  ] = x;
-            dstPts[dstOff+1] = y;
+            dstPts[dstOff  ] = cosχ * sinΛ / B;                             // Easting (x)
+            dstPts[dstOff+1] = (sinχ * cosχ0 - cosχ * sinχ0 * cosΛ) / B;    // Northing (y)
         }
-
         if (!derivate) {
             return null;
         }
+        /*
+         * Now compute the derivative, if the user asked for it.
+         * Notes:
+         *
+         *     ∂Sa/∂λ = 0
+         *     ∂Sb/∂λ = 0
+         *      ∂w/∂λ = 0
+         *      ∂χ/∂λ = 0
+         *     ∂Sa/∂φ =  2⋅cosφ   / (1 -  sinφ)²
+         *     ∂Sb/∂φ = -2⋅ℯ⋅cosφ / (1 - ℯ⋅sinφ)²
+         *      ∂w/∂φ =  2⋅n⋅w⋅(1/cosφ - ℯ²⋅cosφ/(1 - ℯ²⋅sin²φ));
+         */
+        final double cosφ = cos(φ);
+        final double dχ_dφ = (1/cosφ - cosφ*excentricitySquared/(1 - ℯsinφ*ℯsinφ)) * 2*n*sqrt(w) / (w + 1);
 
-        final double cosφ   = cos(φ);
-        final double B2     = B * B;
-
-        //-- derivative code
-        //-- dSa_dλ = 0;
-        final double dSa_dφ = 2 * cosφ / (v1_sinφ * v1_sinφ);
-
-        //-- dSb_dλ = 0;
-        final double dSb_dφ = - 2 * excentricity * cosφ / (v1esinφ * v1esinφ);
-
-        //-- dsasbpowex_dλ = 0;
-        final double dsasbpowex_dφ = dSa_dφ * sbpowex + Sa * excentricity * dSb_dφ * pow(Sb, excentricity - 1);
-
-        //-- dw_dλ = 0;
-        final double dw_dφ = c * n * dsasbpowex_dφ * pow(sasbpowex, n - 1);
-
-        //-- dχ_dλ = 0;
-        final double dχ_dφ = dw_dφ / (w1 * sqrt(w));
-
-        final double addsinχsinχ0 = sinχ + sinχ0;
-
-        //-- Jacobian coefficients
-        final double dx_dλ = cosχ * (cosλ * (1 + sinχsinχ0) + cosχcosχ0) / B2;
-
-        final double dx_dφ = - dχ_dφ * sinλ * addsinχsinχ0 / B2;
-
-        final double dy_dλ = cosχsinλ * addsinχsinχ0 / B2;
-
-        final double dy_dφ = dχ_dφ * (cosχcosχ0 + cosλ * (sinχsinχ0 + 1)) / B2;
-
-        return new Matrix2(dx_dλ, dx_dφ,
-                           dy_dλ, dy_dφ);
+        final double B2 = B * B;
+        final double d = (cosχcosχ0 + cosΛ * (sinχsinχ0 + 1)) / B2;     // Matrix diagonal
+        final double t = sinΛ * (sinχ + sinχ0) / B2;                    // Matrix anti-diagonal
+        /*                   ┌              ┐
+         *                   │ ∂x/∂λ, ∂x/∂φ │
+         * Jacobian        = │              │
+         *    (Proj(λ,φ))    │ ∂y/∂λ, ∂y/∂φ │
+         *                   └              ┘
+         */
+        return new Matrix2(d*cosχ,  -t*dχ_dφ,
+                           t*cosχ,   d*dχ_dφ);
     }
 
     /**
-     * Transforms the specified (x, y) coordinates and stores the result in {@code dstPts} (angles in radians).
+     * Converts the specified (<var>x</var>,<var>y</var>) coordinates and stores the result in {@code dstPts}
+     * (angles in radians).
      *
      * @throws ProjectionException if the point can not be converted.
      */
     @Override
     protected void inverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff) throws ProjectionException {
-        final double x = srcPts[srcOff];
-        final double y = srcPts[srcOff + 1];
-
+        final double x = srcPts[srcOff  ];
+        final double y = srcPts[srcOff+1];
         final double i = atan(x / (h + y));
         final double j = atan(x / (g - y)) - i;
         /*
-         * Longitude coordinate into conformal sphere space is Λ = j + 2 * i
-         * Where λ = Λ + Λ0, but Λ0 is added into normalize matrix which regroup all linears operations.
-         * Also in our particularity case Geodetic longitude λ is the same.
+         * The conformal longitude is  Λ = j + 2i + Λ₀.  In the particular case of stereographic projection,
+         * the geodetic longitude λ is equals to Λ. Furthermore in Apache SIS implementation, Λ₀ is added by
+         * the denormalization matrix and shall not be handled here. The only remaining part is λ = j + 2i.
          */
-        final double λ    = j + 2*i;
-
-        //-- latitude coordinate into conformal sphere space.
-        final double χ    = χ0 + 2*atan((y - x*tan(j/2)));
-        final double sinχ = sin(χ);
-
-        final double ψ = log((1 + sinχ) / (c * (1 - sinχ))) / (2 * n);
-
-        double φi_1 = 2*atan(exp(ψ)) - PI/2;
-
+        final double λ = j + 2*i;
+        /*
+         * Calculation of geodetic latitude φ involves first the calculation of conformal latitude χ,
+         * then calculation of isometric latitude ψ, and finally calculation of φ by an iterative method.
+         */
+        final double sinχ = sin(χ0 + 2*atan(y - x*tan(j/2)));
+        final double ψ = log((1 + sinχ) / ((1 - sinχ)*c)) / (2*n);
+        double φ = 2*atan(exp(ψ)) - PI/2;                               // First approximation
         for (int it = 0; it < MAXIMUM_ITERATIONS; it++) {
-            final double sinφi_1  = sin(φi_1);
-            final double esinφi_1 = excentricity*sinφi_1;
-
-            double ψi_1 = log(tan(φi_1/2 + PI/4) * pow((1 - esinφi_1) / (1 + esinφi_1), excentricity / 2));
-
-            final double φi = φi_1 - (ψi_1 - ψ) * cos(φi_1) * (1 - esinφi_1 * esinφi_1) / eS1;
-
-            if (abs(φi - φi_1) <= ITERATION_TOLERANCE) {
-                dstPts[dstOff]     = λ;
-                dstPts[dstOff + 1] = φi;
+            final double ℯsinφ = excentricity * sin(φ);
+            final double ψi = log(tan(φ/2 + PI/4) * pow((1 - ℯsinφ) / (1 + ℯsinφ), excentricity/2));
+            final double Δφ = (ψ - ψi) * cos(φ) * (1 - ℯsinφ*ℯsinφ) / (1 - excentricitySquared);
+            φ += Δφ;
+            if (abs(Δφ) <= ITERATION_TOLERANCE) {
+                dstPts[dstOff  ] = λ;
+                dstPts[dstOff+1] = φ;
                 return;
             }
-            φi_1 = φi;
         }
         throw new ProjectionException(Errors.Keys.NoConvergence);
     }
 
     /**
      * Provides the transform equations for the spherical case of the Oblique Stereographic projection.
-     * In other words means {@link #excentricity} = 0.
+     * This implementation can be used when {@link #excentricity} = 0.
      *
      * @author  Rémi Maréchal (Geomatys)
      * @author  Martin Desruisseaux (Geomatys)
-     * @since   0.6
+     * @since   0.7
      * @version 0.7
      * @module
      */
     static final class Spherical extends ObliqueStereographic {
         /**
+         * For cross-version compatibility.
+         */
+        private static final long serialVersionUID = -1454098847621943639L;
+
+        /**
          * Constructs a new map projection from the supplied parameters.
          *
          * @param parameters The parameters of the projection to be created.
@@ -403,44 +377,31 @@ public class ObliqueStereographic extend
          */
         @Override
         public Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) throws ProjectionException {
-            final double φ = srcPts[srcOff + 1];
-            final double λ = srcPts[srcOff];
-
+            final double λ = srcPts[srcOff  ];
+            final double φ = srcPts[srcOff+1];
+            /*
+             * In the spherical case,  φ = χ  and  λ = Λ.
+             */
             final double sinφ      = sin(φ);
             final double cosφ      = cos(φ);
-            final double cosλ      = cos(λ);
             final double sinλ      = sin(λ);
-            final double sinφsinχ0 = sinφ * sinχ0;
-            final double cosφcosχ0 = cosφ * cosχ0;
+            final double cosλ      = cos(λ);
+            final double sinφsinφ0 = sinφ * sinχ0;
+            final double cosφcosφ0 = cosφ * cosχ0;
             final double cosφsinλ  = cosφ * sinλ;
-
-            final double B = 1 + sinφsinχ0 + cosφcosχ0 * cosλ;
-
-            final double y = (sinφ * cosχ0 - cosφ * sinχ0 * cosλ) / B;
-            final double x =  cosφsinλ / B;
-
+            final double B = 1 + sinφsinφ0 + cosφcosφ0 * cosλ;
             if (dstPts != null) {
-                dstPts[dstOff  ] = x;
-                dstPts[dstOff+1] = y;
+                dstPts[dstOff  ] = cosφsinλ / B;
+                dstPts[dstOff+1] = (sinφ*cosχ0 - cosφ*sinχ0 *cosλ) / B;
             }
-
             if (!derivate) {
                 return null;
             }
-
             final double B2 = B * B;
-
-            //-- Jacobian coefficients
-            final double dx_dλ =   cosφ * (cosλ * (1 + sinφsinχ0) + cosφcosχ0) / B2;
-
-            final double dx_dφ = - sinλ * (sinφ + sinχ0) / B2;
-
-            final double dy_dλ =   cosφsinλ * (sinχ0 + sinφ) / B2;
-
-            final double dy_dφ =  (cosφcosχ0 + cosλ * (sinφsinχ0 + 1)) / B2;
-
-            return new Matrix2(dx_dλ, dx_dφ,
-                               dy_dλ, dy_dφ);
+            final double d = (cosφcosφ0 + cosλ * (sinφsinφ0 + 1)) / B2;
+            final double t = sinλ * (sinφ + sinχ0) / B2;
+            return new Matrix2(d*cosφ, -t,
+                               t*cosφ,  d);
         }
 
         /**
@@ -451,17 +412,17 @@ public class ObliqueStereographic extend
             final double x = srcPts[srcOff  ];
             final double y = srcPts[srcOff+1];
             final double ρ = hypot(x, y);
-            double λ, φ;
-            if (abs(ρ) < EPSILON) {
+            final double λ, φ;
+            if (abs(ρ) < ANGULAR_TOLERANCE) {
                 φ = χ0;
                 λ = 0.0;
             } else {
-                final double c    = 2 * atan(ρ);
+                final double c    = 2*atan(ρ);
                 final double cosc = cos(c);
                 final double sinc = sin(c);
-                final double ct   = ρ * cosχ0 * cosc - y * sinχ0 * sinc;
+                final double ct   = ρ * cosχ0*cosc - y*sinχ0*sinc;
                 final double t    = x * sinc;
-                φ = asin(cosc * sinχ0 + y * sinc * cosχ0 / ρ);
+                φ = asin(cosc*sinχ0 + y*sinc*cosχ0 / ρ);
                 λ = atan2(t, ct);
             }
             dstPts[dstOff]   = λ;

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java?rev=1709443&r1=1709442&r2=1709443&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java [UTF-8] Mon Oct 19 16:18:31 2015
@@ -41,6 +41,13 @@ import static org.apache.sis.internal.ut
 
 /**
  * <cite>Polar Stereographic</cite> projection (EPSG codes 9810, 9829, 9830).
+ * This is a special case of {@link ObliqueStereographic} when the projection origin is at a pole.
+ *
+ * <p>EPSG defines three variants for this projection, <cite>A</cite>, <cite>B</cite> and <cite>C</cite>,
+ * which differ by the way the parameters are specified. The <cite>"Polar Stereographic (variant B)"</cite>
+ * projection includes a <cite>"Latitude of standard parallel"</cite> parameter where is effective the scale factor
+ * (normally 1). The <cite>"Polar Stereographic (variant A)"</cite> forces its <cite>"Latitude of natural origin"</cite>
+ * parameter to ±90°, depending on the hemisphere.</p>
  *
  * @author  Gerald Evenden (USGS)
  * @author  André Gosselin (MPO)
@@ -51,7 +58,6 @@ import static org.apache.sis.internal.ut
  * @version 0.6
  * @module
  *
- * @see EquatorialStereographic
  * @see ObliqueStereographic
  */
 public class PolarStereographic extends ConformalProjection {
@@ -316,7 +322,7 @@ public class PolarStereographic extends
     }
 
     /**
-     * Transforms the specified (x,y) coordinates and stores the result in {@code dstPts} (angles in radians).
+     * Converts the specified (x,y) coordinates and stores the result in {@code dstPts} (angles in radians).
      *
      * @throws ProjectionException if the point can not be converted.
      */

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java?rev=1709443&r1=1709442&r2=1709443&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java [UTF-8] Mon Oct 19 16:18:31 2015
@@ -383,33 +383,30 @@ public class TransverseMercator extends
             sinh_8η0 = sinh_4η0 * cosh_4η0;             assert identityEquals(sinh_8η0, sinh(8*η0) / 8) : η0;
         }
         /*
-         * Assuming that (λ, φ) ↦ Proj((λ, φ))
-         * where Proj is defined by: Proj((λ, φ)) : (η(λ, φ), ξ(λ, φ)).
-         *
-         * => (λ, φ) ↦ (η(λ, φ), ξ(λ, φ)).
+         * The projection of (λ,φ) is given by (η⋅B, ξ⋅B+M₀) — ignoring scale factors and false easting/northing.
+         * But the B and M₀ parameters have been merged by the constructor with other linear operations in the
+         * "denormalization" matrix. Consequently we only need to compute (η,ξ) below.
          */
-        //-- ξ(λ, φ)
-        final double ξ = cf8 * sin_8ξ0 * cosh_8η0
-                       + cf6 * sin_6ξ0 * cosh_6η0
-                       + cf4 * sin_4ξ0 * cosh_4η0
-                       + cf2 * sin_2ξ0 * cosh_2η0
-                       + ξ0;
-
-        //-- η(λ, φ)
-        final double η = cf8 * cos_8ξ0 * sinh_8η0
-                       + cf6 * cos_6ξ0 * sinh_6η0
-                       + cf4 * cos_4ξ0 * sinh_4η0
-                       + cf2 * cos_2ξ0 * sinh_2η0
-                       + η0;
-
         if (dstPts != null) {
-            dstPts[dstOff  ] = η;
-            dstPts[dstOff+1] = ξ;
+            // η(λ,φ)
+            dstPts[dstOff  ] = cf8 * cos_8ξ0 * sinh_8η0
+                             + cf6 * cos_6ξ0 * sinh_6η0
+                             + cf4 * cos_4ξ0 * sinh_4η0
+                             + cf2 * cos_2ξ0 * sinh_2η0
+                             + η0;
+            // ξ(λ,φ)
+            dstPts[dstOff+1] = cf8 * sin_8ξ0 * cosh_8η0
+                             + cf6 * sin_6ξ0 * cosh_6η0
+                             + cf4 * sin_4ξ0 * cosh_4η0
+                             + cf2 * sin_2ξ0 * cosh_2η0
+                             + ξ0;
         }
         if (!derivate) {
             return null;
         }
-
+        /*
+         * Now compute the derivative, if the user asked for it.
+         */
         final double cosλ          = cos(λ);                                        //-- λ
         final double cosφ          = cos(φ);                                        //-- φ
         final double cosh2Q        = coshQ * coshQ;                                 //-- Q
@@ -428,14 +425,14 @@ public class TransverseMercator extends
         final double dξ0_dλ = sinhQ * sinhη0 * cosλ / (cosh2Q_sin2λ * sqrt1_thQchη0);
         final double dξ0_dφ = (dQ_dφ * coshη0 / cosh2Q + dη0_dφ * sinhη0 * tanhQ) / sqrt1_thQchη0;
         /*
-         * Assuming that Jac(Proj((λ, φ))) is the Jacobian matrix of Proj((λ, φ)) function.
+         * Jac(Proj(λ,φ)) is the Jacobian matrix of Proj(λ,φ) function.
+         * So the derivative of Proj(λ,φ) is defined by:
          *
-         * So the derivative of Proj((λ, φ)) is defined by:
-         *                    ┌                              ┐
-         *                    │ dη(λ, φ) / dλ, dη(λ, φ) / dφ │
-         * Jac              = │                              │
-         *    (Proj(λ, φ))    │ dξ(λ, φ) / dλ, dξ(λ, φ) / dφ │
-         *                    └                              ┘
+         *                   ┌                        ┐
+         *                   │ ∂η(λ,φ)/∂λ, ∂η(λ,φ)/∂φ │
+         * Jac             = │                        │
+         *    (Proj(λ,φ))    │ ∂ξ(λ,φ)/∂λ, ∂ξ(λ,φ)/∂φ │
+         *                   └                        ┘
          */
         //-- dξ(λ, φ) / dλ
         final double dξ_dλ = dξ0_dλ

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/LambertConicConformalTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/LambertConicConformalTest.java?rev=1709443&r1=1709442&r2=1709443&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/LambertConicConformalTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/LambertConicConformalTest.java [UTF-8] Mon Oct 19 16:18:31 2015
@@ -166,10 +166,10 @@ public final strictfp class LambertConic
     @Test
     @DependsOnMethod("testSpecialLatitudes")
     public void testDerivative() throws TransformException {
-        if (transform == null) {    // May have been initialized by 'testSphericalCase'.
-            createNormalizedProjection(true, 40);   // Elliptical case
+        if (transform == null) {                                // May have been initialized by 'testSphericalCase'.
+            createNormalizedProjection(true, 40);               // Elliptical case
         }
-        final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+        final double delta = toRadians(100.0 / 60) / 1852;      // Approximatively 100 metres.
         derivativeDeltas = new double[] {delta, delta};
         tolerance = 1E-9;
         verifyDerivative(toRadians( 0), toRadians( 0));

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java?rev=1709443&r1=1709442&r2=1709443&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java [UTF-8] Mon Oct 19 16:18:31 2015
@@ -117,12 +117,12 @@ public final strictfp class MercatorTest
     @Test
     @DependsOnMethod("testSpecialLatitudes")
     public void testDerivative() throws TransformException {
-        if (transform == null) {    // May have been initialized by 'testSphericalCase'.
-            createNormalizedProjection(true);       // Elliptical case
+        if (transform == null) {                                // May have been initialized by 'testSphericalCase'.
+            createNormalizedProjection(true);                   // Elliptical case
         }
-        final double delta = toRadians(100.0 / 60) / 1852;    // Approximatively 100 metres.
+        final double delta = toRadians(100.0 / 60) / 1852;      // Approximatively 100 metres.
         derivativeDeltas = new double[] {delta, delta};
-        tolerance = 1E-9;    // More severe than Formulas.LINEAR_TOLERANCE.
+        tolerance = 1E-9;                                       // More severe than Formulas.LINEAR_TOLERANCE.
         verifyDerivative(toRadians(15), toRadians( 30));
         verifyDerivative(toRadians(10), toRadians(-60));
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java?rev=1709443&r1=1709442&r2=1709443&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java [UTF-8] Mon Oct 19 16:18:31 2015
@@ -159,7 +159,7 @@ public final strictfp class ObliqueStere
         final double[] srcPts = new double[] {λt, φt};   // in degrees
         final double[] dstPts = new double[2];
 
-        // Linear operations (normalization) applied by NormalizedTransform.
+        // Linear operations (normalization) applied before NormalizedTransform.
         srcPts[0] = toRadians(srcPts[0]) - λ0;
         srcPts[1] = toRadians(srcPts[1]);
         srcPts[0] *= n;
@@ -168,7 +168,7 @@ public final strictfp class ObliqueStere
         createNormalizedProjection(true);
         transform.transform(srcPts, 0, dstPts, 0, 1);
 
-        // Linear operations (denormalization) applied by NormalizedTransform.
+        // Linear operations (denormalization) applied after NormalizedTransform.
         dstPts[0] *= (k0 * 2*R);
         dstPts[1] *= (k0 * 2*R);
         dstPts[0] += FE;
@@ -189,7 +189,7 @@ public final strictfp class ObliqueStere
         final double[] srcPts = new double[] {Et, Nt};  // in metres
         final double[] dstPts = new double[2];
 
-        // Linear operations (normalization) applied by NormalizedTransform.
+        // Linear operations (normalization) applied before NormalizedTransform.
         srcPts[0] -= FE;
         srcPts[1] -= FN;
         srcPts[0] /= (k0 * 2*R);
@@ -199,7 +199,7 @@ public final strictfp class ObliqueStere
         createNormalizedProjection(true);
         ((NormalizedProjection) transform).inverseTransform(srcPts, 0, dstPts, 0);
 
-        // Linear operations (denormalization) applied by NormalizedTransform.
+        // Linear operations (denormalization) applied after NormalizedTransform.
         dstPts[0] /= n;
         dstPts[0] = toDegrees(dstPts[0] + λ0);
         dstPts[1] = toDegrees(dstPts[1]);
@@ -237,7 +237,7 @@ public final strictfp class ObliqueStere
         final double[] dstPts = new double[2];
         final double[] refPts = new double[2];
 
-        // Linear operations (normalization) applied by NormalizedTransform.
+        // Linear operations (normalization) applied before NormalizedTransform.
         srcPts[0] = toRadians(srcPts[0]) - λ0;
         srcPts[1] = toRadians(srcPts[1]);
         srcPts[0] *= n;
@@ -246,7 +246,7 @@ public final strictfp class ObliqueStere
         createNormalizedProjection(false);
         transform.transform(srcPts, 0, refPts, 0, 1);
 
-        // Linear operations (denormalization) applied by NormalizedTransform.
+        // Linear operations (denormalization) applied after NormalizedTransform.
         refPts[0] *= (k0 * 2*R);
         refPts[1] *= (k0 * 2*R);
         refPts[0] += FE;
@@ -257,7 +257,7 @@ public final strictfp class ObliqueStere
         spherical = new ObliqueStereographic.Spherical(spherical);
         spherical.transform(srcPts, 0, dstPts, 0, 1);
 
-        // Linear operations (denormalization) applied by NormalizedTransform.
+        // Linear operations (denormalization) applied after NormalizedTransform.
         dstPts[0] *= (k0 * 2*R);
         dstPts[1] *= (k0 * 2*R);
         dstPts[0] += FE;
@@ -281,7 +281,7 @@ public final strictfp class ObliqueStere
         final double[] dstPts = new double[2];
         final double[] refPts = new double[2];
 
-        // Linear operations (normalization) applied by NormalizedTransform.
+        // Linear operations (normalization) applied before NormalizedTransform.
         srcPts[0] -= FE;
         srcPts[1] -= FN;
         srcPts[0] /= (k0 * 2*R);
@@ -291,7 +291,7 @@ public final strictfp class ObliqueStere
         createNormalizedProjection(false);
         ((NormalizedProjection) transform).inverseTransform(srcPts, 0, refPts, 0);
 
-        // Linear operations (denormalization) applied by NormalizedTransform.
+        // Linear operations (denormalization) applied after NormalizedTransform.
         refPts[0] /= n;
         refPts[0] = toDegrees(refPts[0] + λ0);
         refPts[1] = toDegrees(refPts[1]);
@@ -301,7 +301,7 @@ public final strictfp class ObliqueStere
         spherical = new ObliqueStereographic.Spherical(spherical);
         spherical.inverseTransform(srcPts, 0, dstPts, 0);
 
-        // Linear operations (denormalization) applied by NormalizedTransform.
+        // Linear operations (denormalization) applied after NormalizedTransform.
         dstPts[0] /= n;
         dstPts[0] = toDegrees(dstPts[0] + λ0);
         dstPts[1] = toDegrees(dstPts[1]);
@@ -350,7 +350,7 @@ public final strictfp class ObliqueStere
         createNormalizedProjection(true);
         tolerance = 1E-9;
 
-        final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+        final double delta = toRadians(100.0 / 60) / 1852;      // Approximatively 100 metres.
         derivativeDeltas = new double[] {delta, delta};
         verifyDerivative(toRadians( 0), toRadians( 0));
         verifyDerivative(toRadians(-3), toRadians(30));

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java?rev=1709443&r1=1709442&r2=1709443&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java [UTF-8] Mon Oct 19 16:18:31 2015
@@ -70,7 +70,7 @@ public final strictfp class PolarStereog
     @Test
     public void testSphericalCaseSouth() throws FactoryException, TransformException {
         createNormalizedProjection(new PolarStereographicSouth());
-        final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+        final double delta = toRadians(100.0 / 60) / 1852;          // Approximatively 100 metres.
         derivativeDeltas = new double[] {delta, delta};
         verifyInDomain(CoordinateDomain.GEOGRAPHIC_RADIANS_SOUTH, 56763886);
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java?rev=1709443&r1=1709442&r2=1709443&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java [UTF-8] Mon Oct 19 16:18:31 2015
@@ -117,7 +117,7 @@ public final strictfp class TransverseMe
         createNormalizedProjection(false, 0);
         tolerance = 1E-9;
 
-        final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+        final double delta = toRadians(100.0 / 60) / 1852;      // Approximatively 100 metres.
         derivativeDeltas = new double[] {delta, delta};
         verifyDerivative(toRadians( 0), toRadians( 0));
         verifyDerivative(toRadians(-3), toRadians(30));
@@ -134,7 +134,7 @@ public final strictfp class TransverseMe
         createNormalizedProjection(true, 0);
         tolerance = 1E-9;
 
-        final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+        final double delta = toRadians(100.0 / 60) / 1852;      // Approximatively 100 metres.
         derivativeDeltas = new double[] {delta, delta};
         verifyDerivative(toRadians( 0), toRadians( 0));
         verifyDerivative(toRadians(-3), toRadians(30));



Mime
View raw message