Changeset 14091 in josm for trunk/src/org/openstreetmap/josm/data/projection
- Timestamp:
- 2018-08-05T20:11:27+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/proj/AzimuthalEquidistant.java
r13601 r14091 214 214 double lambda = 0; 215 215 double phi = 0; 216 double c _rh = Math.hypot(x, y);217 if (c _rh > Math.PI) {218 if (c _rh - EPS10 > Math.PI) {216 double cRh = Math.hypot(x, y); 217 if (cRh > Math.PI) { 218 if (cRh - EPS10 > Math.PI) { 219 219 throw new JosmRuntimeException("TOLERANCE_ERROR"); 220 220 } 221 } else if (c _rh < EPS10) {221 } else if (cRh < EPS10) { 222 222 phi = latitudeOfOrigin; 223 223 lambda = 0.; 224 224 } else { 225 225 if (mode == Mode.OBLIQUE || mode == Mode.EQUATORIAL) { 226 double sinc = Math.sin(c _rh);227 double cosc = Math.cos(c _rh);226 double sinc = Math.sin(cRh); 227 double cosc = Math.cos(cRh); 228 228 if (mode == Mode.EQUATORIAL) { 229 phi = aasin(y * sinc / c _rh);229 phi = aasin(y * sinc / cRh); 230 230 x *= sinc; 231 y = cosc * c _rh;231 y = cosc * cRh; 232 232 } else { // Oblique 233 phi = aasin(cosc * sinph0 + y * sinc * cosph0 / c _rh);234 y = (cosc - sinph0 * Math.sin(phi)) * c _rh;233 phi = aasin(cosc * sinph0 + y * sinc * cosph0 / cRh); 234 y = (cosc - sinph0 * Math.sin(phi)) * cRh; 235 235 x *= sinc * cosph0; 236 236 } 237 237 lambda = (y == 0) ? 0 : Math.atan2(x, y); 238 238 } else if (mode == Mode.NORTH_POLAR) { 239 phi = HALF_PI - c _rh;239 phi = HALF_PI - cRh; 240 240 lambda = Math.atan2(x, -y); 241 241 } else { // South Polar 242 phi = c _rh - HALF_PI;242 phi = cRh - HALF_PI; 243 243 lambda = Math.atan2(x, y); 244 244 }
Note:
See TracChangeset
for help on using the changeset viewer.