Changeset 9532 in josm for trunk/src/org/openstreetmap/josm/data/projection/proj
 Timestamp:
 20160118T22:48:40+01:00 (5 years ago)
 Location:
 trunk/src/org/openstreetmap/josm/data/projection/proj
 Files:

 2 added
 2 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 = 1E10; 30 31 /** 27 32 * Relative iteration precision used in the <code>mlfn</code> method 28 33 */ … … 153 158 154 159 /** 160 * Iteratively solve equation (79) 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((1con)/(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 1415), where <var>s</var> and <var>c</var> are the sine and cosine of 
trunk/src/org/openstreetmap/josm/data/projection/proj/ProjParameters.java
r9419 r9532 14 14 public Double lat1; 15 15 public Double lat2; 16 17 // Polar Stereographic 16 18 public Double lat_ts; 19 20 // Oblique Mercator 21 public Double lonc; 22 public Double alpha; 23 public Double gamma; 24 public Boolean no_off; 25 public Double lon1; 26 public Double lon2; 17 27 }
Note: See TracChangeset
for help on using the changeset viewer.