sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 02/02: Take flattening in account when computing (∂y/∂φ)⁻¹.
Date Thu, 01 Aug 2019 16:41:29 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 7d277eb90097be7c9143c5e56b90be78483b3e44
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Thu Aug 1 16:37:19 2019 +0200

    Take flattening in account when computing (∂y/∂φ)⁻¹.
---
 .../org/apache/sis/referencing/GeodesicsOnEllipsoid.java    | 13 +++++++++++++
 .../java/org/apache/sis/referencing/GeodeticCalculator.java |  6 ++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodesicsOnEllipsoid.java
b/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodesicsOnEllipsoid.java
index ca063f4..ae60e24 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodesicsOnEllipsoid.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodesicsOnEllipsoid.java
@@ -885,6 +885,19 @@ class GeodesicsOnEllipsoid extends GeodeticCalculator {
     }
 
     /**
+     * Computes (∂y/∂φ)⁻¹ at the given latitude on an ellipsoid with semi-major axis
length of 1.
+     * This derivative is close to cos(φ) for a slightly flattened sphere.
+     *
+     * @see org.apache.sis.referencing.operation.projection.ConformalProjection#dy_dφ
+     */
+    @Override
+    double dφ_dy(final double φ) {
+        final double sinφ = sin(φ);
+        final double cosφ = cos(φ);
+        return cosφ/(1  -  eccentricitySquared * (cosφ*cosφ) / (1 - eccentricitySquared
* (sinφ*sinφ)));
+    }
+
+    /**
      * Takes a snapshot of the current fields in this class. This is used for JUnit tests
only. During development phases,
      * {@link #STORE_LOCAL_VARIABLES} should be {@code true} for allowing {@code GeodesicsOnEllipsoidTest}
to verify the
      * values of a large range of local variables. But when the storage of locale variables
is disabled, this method allows
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodeticCalculator.java
b/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodeticCalculator.java
index e6b0569..3e63721 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodeticCalculator.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodeticCalculator.java
@@ -165,7 +165,9 @@ public class GeodeticCalculator {
      *
      * <ul>
      *   <li>m⋅sin(α) is proportional to a displacement in the λ direction.</li>
-     *   <li>m⋅cos(α) is proportional to a displacement in the φ direction.</li>
+     *   <li>m⋅cos(α) is proportional to a displacement in the φ direction.
+     *     The unit of measurement is the unit of any conformal projection.
+     *     For representing a displacement in degrees, divide by {@linkplain #dφ_dy(double)
∂y/∂φ}.</li>
      * </ul>
      *
      * Those vectors may not be normalized to unitary vectors. For example {@code msinα}
is {@code sinα} multiplied
@@ -561,7 +563,7 @@ public class GeodeticCalculator {
      *
      * @see org.apache.sis.referencing.operation.projection.ConformalProjection#dy_dφ
      */
-    private double dφ_dy(final double φ) {
+    double dφ_dy(final double φ) {
         return cos(φ);
     }
 


Mime
View raw message