Changeset 14091 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-08-05T20:11:27+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r13966 r14091 234 234 // rounding errors could make the argument of asin greater than 1 235 235 // (This should almost never happen.) 236 if ( java.lang.Double.isNaN(d)) {236 if (Double.isNaN(d)) { 237 237 Logging.error("NaN in greatCircleDistance"); 238 238 d = PI * WGS84.a; -
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 } -
trunk/src/org/openstreetmap/josm/tools/WindowsShortcut.java
r13698 r14091 44 44 */ 45 45 public static boolean isPotentialValidLink(File file) throws IOException { 46 final int minimum _length = 0x64;46 final int minimumLength = 0x64; 47 47 boolean isPotentiallyValid = false; 48 48 try (InputStream fis = Files.newInputStream(file.toPath())) { 49 49 isPotentiallyValid = file.isFile() 50 50 && file.getName().toLowerCase(Locale.ENGLISH).endsWith(".lnk") 51 && fis.available() >= minimum _length51 && fis.available() >= minimumLength 52 52 && isMagicPresent(getBytes(fis, 32)); 53 53 } … … 126 126 private static boolean isMagicPresent(byte[] link) { 127 127 final int magic = 0x0000004C; 128 final int magic _offset = 0x00;129 return link.length >= 32 && bytesToDword(link, magic _offset) == magic;128 final int magicOffset = 0x00; 129 return link.length >= 32 && bytesToDword(link, magicOffset) == magic; 130 130 } 131 131
Note:
See TracChangeset
for help on using the changeset viewer.