Changeset 9532 in josm for trunk/src/org/openstreetmap/josm/data/projection/proj/AbstractProj.java
- Timestamp:
- 2016-01-18T22:48:40+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/proj/AbstractProj.java
r9432 r9532 25 25 26 26 /** 27 * Difference allowed in iterative computations. 28 */ 29 private static final double ITERATION_TOLERANCE = 1E-10; 30 31 /** 27 32 * Relative iteration precision used in the <code>mlfn</code> method 28 33 */ … … 153 158 154 159 /** 160 * Iteratively solve equation (7-9) from Snyder. 161 */ 162 final double cphi2(final double ts) { 163 final double eccnth = 0.5 * e; 164 double phi = (Math.PI/2) - 2.0 * Math.atan(ts); 165 for (int i=0; i<MAXIMUM_ITERATIONS; i++) { 166 final double con = e * Math.sin(phi); 167 final double dphi = (Math.PI/2) - 2.0*Math.atan(ts * Math.pow((1-con)/(1+con), eccnth)) - phi; 168 phi += dphi; 169 if (Math.abs(dphi) <= ITERATION_TOLERANCE) { 170 return phi; 171 } 172 } 173 throw new RuntimeException("no convergence"); 174 } 175 176 /** 155 177 * Computes function <code>f(s,c,e²) = c/sqrt(1 - s²×e²)</code> needed for the true scale 156 178 * latitude (Snyder 14-15), where <var>s</var> and <var>c</var> are the sine and cosine of
Note:
See TracChangeset
for help on using the changeset viewer.