Author: desruisseaux
Date: Thu May 29 23:21:44 2025
New Revision: 1925964

URL: http://svn.apache.org/viewvc?rev=1925964&view=rev
Log:
Add the tools that were used for deriving the formulas of the Jacobian of the 
"Geographic to spherical" conversion.
https://issues.apache.org/jira/browse/SIS-302

Added:
    sis/analysis/Geographic to spherical/
    sis/analysis/Geographic to spherical/Derivatives.txt
    sis/analysis/Geographic to spherical/Derivatives.wxmx   (with props)
    sis/analysis/Geographic to spherical/Simplify.xml

Added: sis/analysis/Geographic to spherical/Derivatives.txt
URL: 
http://svn.apache.org/viewvc/sis/analysis/Geographic%20to%20spherical/Derivatives.txt?rev=1925964&view=auto
==============================================================================
--- sis/analysis/Geographic to spherical/Derivatives.txt (added)
+++ sis/analysis/Geographic to spherical/Derivatives.txt Thu May 29 23:21:44 
2025
@@ -0,0 +1,20 @@
+#
+# Results copied from "Derivatives.wxmx" as plain text.
+# For each derivative, the first line is copied verbatim.
+# The second line is the result of `ant -f Simplify.xml`
+# together with manual editions.
+#
+
+∂Ω/∂φ: diff(L, φ);
+((e^2*(1-e^2)*sin(φ)^2)/((1-e^2*sin(φ)^2)^(3/2)*(1/sqrt(1-e^2*sin(φ)^2)+h))+(sin(φ)^2*((1-e^2)/sqrt(1-e^2*sin(φ)^2)+h))/(cos(φ)^2*(1/sqrt(1-e^2*sin(φ)^2)+h))+((1-e^2)/sqrt(1-e^2*sin(φ)^2)+h)/(1/sqrt(1-e^2*sin(φ)^2)+h)-(e^2*sin(φ)^2*((1-e^2)/sqrt(1-e^2*sin(φ)^2)+h))/((1-e^2*sin(φ)^2)^(3/2)*(1/sqrt(1-e^2*sin(φ)^2)+h)^2))/((sin(φ)^2*((1-e^2)/sqrt(1-e^2*sin(φ)^2)+h)^2)/(cos(φ)^2*(1/sqrt(1-e^2*sin(φ)^2)+h)^2)+1)
+
+∂Ω/∂h: diff(L, h);
+(sin(φ)/(cos(φ)*(1/sqrt(1-e^2*sin(φ)^2)+h))-(sin(φ)*((1-e^2)/sqrt(1-e^2*sin(φ)^2)+h))/(cos(φ)*(1/sqrt(1-e^2*sin(φ)^2)+h)^2))/((sin(φ)^2*((1-e^2)/sqrt(1-e^2*sin(φ)^2)+h)^2)/(cos(φ)^2*(1/sqrt(1-e^2*sin(φ)^2)+h)^2)+1)
+After simplification: cosφ*(sinφ*r - Z) / (R*R)
+
+∂R/∂φ: diff(R, φ);
+(2*cos(φ)*sin(φ)*((1-e^2)/sqrt(1-e^2*sin(φ)^2)+h)^2-2*cos(φ)*sin(φ)*(1/sqrt(1-e^2*sin(φ)^2)+h)^2+(2*e^2*(1-e^2)*cos(φ)*sin(φ)^3*((1-e^2)/sqrt(1-e^2*sin(φ)^2)+h))/(1-e^2*sin(φ)^2)^(3/2)+(2*e^2*cos(φ)^3*sin(φ)*(1/sqrt(1-e^2*sin(φ)^2)+h))/(1-e^2*sin(φ)^2)^(3/2))/(2*sqrt(sin(φ)^2*((1-e^2)/sqrt(1-e^2*sin(φ)^2)+h)^2+cos(φ)^2*(1/sqrt(1-e^2*sin(φ)^2)+h)^2))
+
+∂R/∂h: diff(R, h);
+(2*sin(φ)^2*((1-e^2)/sqrt(1-e^2*sin(φ)^2)+h)+2*cos(φ)^2*(1/sqrt(1-e^2*sin(φ)^2)+h))/(2*sqrt(sin(φ)^2*((1-e^2)/sqrt(1-e^2*sin(φ)^2)+h)^2+cos(φ)^2*(1/sqrt(1-e^2*sin(φ)^2)+h)^2))
+After simplification: (Z*sinφ + r*cosφ*cosφ) / R

Added: sis/analysis/Geographic to spherical/Derivatives.wxmx
URL: 
http://svn.apache.org/viewvc/sis/analysis/Geographic%20to%20spherical/Derivatives.wxmx?rev=1925964&view=auto
==============================================================================
Binary file - no diff available.

Propchange: sis/analysis/Geographic to spherical/Derivatives.wxmx
------------------------------------------------------------------------------
    svn:mime-type = application/zip

Added: sis/analysis/Geographic to spherical/Simplify.xml
URL: 
http://svn.apache.org/viewvc/sis/analysis/Geographic%20to%20spherical/Simplify.xml?rev=1925964&view=auto
==============================================================================
--- sis/analysis/Geographic to spherical/Simplify.xml (added)
+++ sis/analysis/Geographic to spherical/Simplify.xml Thu May 29 23:21:44 2025
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Simplification of the derivatives. The target values are names of variables
+  used in the `EllipsoidToCentricTransform` Java class. For running, copy the
+  formula to simplify in a temporary file named "formula.txt" then execute on
+  the command line: `ant -f Simplify.xml`.
+
+  Note that this file alone is not sufficient. Manual editions are needed.
+  It can be done by adding parenthesis and executing the Ant script again.
+  For example, if `1*ν` has not been simplified, replace by `(1*ν)`, then
+  re-execute Ant. `1*ν` is a trivial example, but with larger expressions,
+  adding the missing parenthesis is safer than manual simplifications.
+-->
+<project name="Replace" default="replace">
+  <target name="replace">
+    <replace dir="." summary="yes">
+      <include name="formula.txt"/>
+      <replacefilter token="cos(φ)" value="cosφ"/>
+      <replacefilter token="sin(φ)" value="sinφ"/>
+      <replacefilter token="sinφ^2" value="(sinφ*sinφ)"/>
+      <replacefilter token="cosφ^2" value="(cosφ*cosφ)"/>
+      <replacefilter token="sinφ^3" value="(sinφ*sinφ*sinφ)"/>
+      <replacefilter token="cosφ^3" value="(cosφ*cosφ*cosφ)"/>
+
+      <replacefilter token=  "(1/(1-e^2*(sinφ*sinφ)))" value= "ν2"/>
+      <replacefilter token=    "/(1-e^2*(sinφ*sinφ))"  value="*ν2"/>
+      <replacefilter token=    "*(1-e^2*(sinφ*sinφ))"  value="/ν2"/>
+      <replacefilter token="*sqrt(1-e^2*(sinφ*sinφ))"  value= "/ν"/>
+      <replacefilter token="/sqrt(1-e^2*(sinφ*sinφ))"  value= "*ν"/>
+      <replacefilter token=     "(1-e^2*(sinφ*sinφ))"  value= "(1/ν2)"/>
+      <replacefilter token="sqrt(ν2)"                  value= "ν"/>
+      <replacefilter token="ν2^(3/2)"                  value="(ν2*ν)"/>
+      <replacefilter token="(1/ν2)^(3/2)"              value="(1/(ν2*ν))"/>
+      <replacefilter token="(ν*(1-e^2))"               value= "νℯ"/>
+      <replacefilter token="((1-e^2)*ν)"               value= "νℯ"/>
+      <replacefilter token="((1-e^2)*ν+h)"             value= "(νℯ+h)"/>
+      <replacefilter token="(1*ν+h)"                   value= "(ν+h)"/>
+      <replacefilter token="(1*ν)"                     value= "ν"/>
+
+      <replacefilter token="(ν+h)"                  value= "r"/>
+      <replacefilter token="((νℯ+h)*sinφ)"          value= "Z"/>
+      <replacefilter token="(sinφ*(νℯ+h))"          value= "Z"/>
+      <replacefilter token="((νℯ+h)^2*(sinφ*sinφ))" value="(Z*Z)"/>
+      <replacefilter token="((sinφ*sinφ)*(νℯ+h)^2)" value="(Z*Z)"/>
+      <replacefilter token="((sinφ*sinφ)*(νℯ+h))"   value="(sinφ*Z)"/>
+      <replacefilter token="(sinφ^3*(νℯ+h))"        
value="(sinφ*sinφ*Z)"/>
+      <replacefilter token="(sinφ*(νℯ+h)^2)"        value="(Z*Z/sinφ)"/>
+      <replacefilter token="Z^2"                    value="(Z*Z)"/>
+
+      <replacefilter token="(r*cosφ)"           value="rcosφ"/>
+      <replacefilter token="((cosφ*cosφ)*r^2)"  value="(rcosφ*rcosφ)"/>
+      <replacefilter token="(r^2*(cosφ*cosφ))"  value="(rcosφ*rcosφ)"/>
+      <replacefilter token="(r^2*cosφ*cosφ)"    value="(rcosφ*rcosφ)"/>
+      <replacefilter token="((cosφ*cosφ)*r)"    value="(cosφ*rcosφ)"/>
+
+      <replacefilter token="((Z*Z)/(rcosφ*rcosφ)+1)" 
value="(((Z*Z)+(rcosφ*rcosφ))/(rcosφ*rcosφ))"/>
+      <replacefilter token="sqrt((Z*Z)+rcosφ*rcosφ)" value="R"/>
+      <replacefilter token="((Z*Z)+(rcosφ*rcosφ))"   value="(R*R)"/>
+    </replace>
+  </target>
+</project>


Reply via email to