sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1708823 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/referencing/operation/projection/Initializer.java test/java/org/apache/sis/referencing/operation/projection/InitializerTest.java
Date Thu, 15 Oct 2015 14:09:40 GMT
Author: desruisseaux
Date: Thu Oct 15 14:09:40 2015
New Revision: 1708823

URL: http://svn.apache.org/viewvc?rev=1708823&view=rev
Log:
Minor formatting (no code change).

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/test/java/org/apache/sis/referencing/operation/projection/InitializerTest.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=1708823&r1=1708822&r2=1708823&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] Thu Oct 15 14:09:40 2015
@@ -55,8 +55,9 @@ import static org.apache.sis.internal.ut
  * in some relatively rare scenarios like 1 ± x where <var>x</var> is much smaller
than 1.</p>
  *
  * @author  Martin Desruisseaux (Geomatys)
+ * @author  Rémi Marechal (Geomatys)
  * @since   0.6
- * @version 0.6
+ * @version 0.7
  * @module
  */
 final class Initializer {
@@ -295,7 +296,7 @@ final class Initializer {
         final DoubleDouble t = verbatim(sinφ);
         t.square();
         t.multiply(excentricitySquared);
-        
+
         // Compute 1 - ℯ²⋅sin²φ.  Since  ℯ²⋅sin²φ  may be small,
         // this is where double-double arithmetic has more value.
         t.negate();
@@ -304,28 +305,25 @@ final class Initializer {
     }
 
     /**
-     * Returns the radius of the conformal sphere.
-     *
-     * The radius of conformal sphere is computed from ρ,
-     * which is the radius of curvature in the meridian,
-     * and ν which is the radius of curvature in the prime vertical,
-     * like follow :
-     *
-     * <blockquote>Rc = √(ρ ν) = √(1 – e²) / (1 – e²sin²φ)</blockquote>
-     *
-     * This is a function of latitude and therefore not constant. When used for
-     * spherical projections the use of φO(or φ1as relevant to method) for φis
-     * suggested, except if the projection is equal area
-     * when the radius of authalic sphere should be used.
+     * 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:
+     *
+     * <blockquote>Rc = √(ρ⋅ν) = √(1 – ℯ²) / (1 – ℯ²sin²φ)</blockquote>
+     *
+     * This is a function of latitude and therefore not constant. When used for spherical
projections
+     * the use of φ₀ (or φ₁ as relevant to method) for φ is suggested, except if the
projection is
+     * equal area when the radius of authalic sphere should be used.
      *
-     * @param sinφ The sine of the φ latitude.
-     * @return radius of the conformal sphere at latitude φ.
+     * @param  sinφ The sine of the φ latitude.
+     * @return Radius of the conformal sphere at latitude φ.
      */
     final double radiusOfConformalSphere(final double sinφ) {
         final DoubleDouble Rc = verbatim(1);
-        Rc.subtract(excentricitySquared); //-- 1 - e²
-        Rc.sqrt();                        //-- √1 - e²
-        Rc.divide(rν2(sinφ));           //-- (√1 - e²) * (1 / (1 - e²sin²φ))
+        Rc.subtract(excentricitySquared);   //-- 1 - ℯ²
+        Rc.sqrt();                          //-- √(1 - ℯ²)
+        Rc.divide(rν2(sinφ));               //-- √(1 - ℯ²) / (1 - ℯ²sin²φ)
         return Rc.value;
     }
 

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/InitializerTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/InitializerTest.java?rev=1708823&r1=1708822&r2=1708823&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/InitializerTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/InitializerTest.java
[UTF-8] Thu Oct 15 14:09:40 2015
@@ -33,39 +33,39 @@ import org.opengis.test.TestCase;
 
 
 /**
- * Test about computing method from
- * <a href = http://www.iogp.org/pubs/373-07-2.pdf> EPSG guide</a>
+ * Tests the {@link Initializer} class.
  *
- * @author Rémi Marechal (Geomatys).
- * @author Martin Desruisseaux (Geomatys)
+ * @author  Rémi Marechal (Geomatys)
+ * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
  * @version 0.7
  * @module
  */
 public strictfp class InitializerTest extends TestCase{
     /**
-     * Test computing of Radius of conformal Sphere.
+     * Tests the {@link Initializer#radiusOfConformalSphere(double)} method.
+     * This test compute the Radius of conformal Sphere using the values given by the
+     * <a href = http://www.iogp.org/pubs/373-07-2.pdf>EPSG guide</a> for the
Stereographic projection.
      *
      * @see Initializer#radiusOfConformalSphere(double)
      */
     @Test
-    public void testConformalSphereRadius() {
-
-        final EnumMap<NormalizedProjection.ParameterRole, ParameterDescriptor<Double>>
roles = new EnumMap<>(NormalizedProjection.ParameterRole.class);
+    public void testRadiusOfConformalSphere() {
+        final EnumMap<NormalizedProjection.ParameterRole, ParameterDescriptor<Double>>
roles =
+                new EnumMap<>(NormalizedProjection.ParameterRole.class);
         roles.put(NormalizedProjection.ParameterRole.CENTRAL_MERIDIAN, LONGITUDE_OF_ORIGIN);
         roles.put(NormalizedProjection.ParameterRole.SCALE_FACTOR,     SCALE_FACTOR);
         roles.put(NormalizedProjection.ParameterRole.FALSE_EASTING,    FALSE_EASTING);
         roles.put(NormalizedProjection.ParameterRole.FALSE_NORTHING,   FALSE_NORTHING);
 
         final OperationMethod op = new ObliqueStereographic();
-
         final ParameterValueGroup p = op.getParameters().createValue();
 
-        //-- implicit names from OGC.
+        //-- Implicit parameters (OGC names).
         p.parameter("semi_major").setValue(6377397.155);
         p.parameter("inverse_flattening").setValue(299.15281);
 
-        //-- Name parameters from Epsg registry
+        //-- Explicit parameters from EPSG registry
         p.parameter("Latitude of natural origin").setValue(52.156160556);
         p.parameter("Longitude of natural origin").setValue(5.387638889);
         p.parameter("Scale factor at natural origin").setValue(0.9999079);
@@ -74,6 +74,7 @@ public strictfp class InitializerTest ex
 
         final Initializer initializer = new Initializer(op, (Parameters) p, roles, (byte)
0);
 
-        assertEquals("Conformal Sphere Radius", 6382644.571, 6377397.155 * initializer.radiusOfConformalSphere(Math.sin(Math.toRadians(52.156160556))),
Formulas.LINEAR_TOLERANCE);
+        assertEquals("Conformal Sphere Radius", 6382644.571, 6377397.155 *
+                initializer.radiusOfConformalSphere(Math.sin(Math.toRadians(52.156160556))),
Formulas.LINEAR_TOLERANCE);
     }
 }



Mime
View raw message