Changeset 35978 in osm for applications/editors/josm/plugins/simplifyarea/src
- Timestamp:
- 2022-06-15T20:10:48+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/simplifyarea/src/org/openstreetmap/josm/plugins/simplifyarea/SimplifyAreaAction.java
r35976 r35978 29 29 import org.openstreetmap.josm.data.Bounds; 30 30 import org.openstreetmap.josm.data.UndoRedoHandler; 31 import org.openstreetmap.josm.data.coor.ILatLon; 31 32 import org.openstreetmap.josm.data.coor.LatLon; 32 33 import org.openstreetmap.josm.data.osm.Node; … … 257 258 } 258 259 259 final LatLon a = coordMap.get(n1); 260 final LatLon b = coordMap.get(n2); 260 final ILatLon a = coordMap.get(n1); 261 final ILatLon b = coordMap.get(n2); 261 262 262 263 if (a != null && b != null) { … … 419 420 } 420 421 421 public static double computeConvectAngle(final LatLon coord1, final LatLon coord2, final LatLon coord3) { 422 public static double computeConvectAngle(final ILatLon coord1, final ILatLon coord2, final ILatLon coord3) { 422 423 final double angle = Math.abs(heading(coord2, coord3) - heading(coord1, coord2)); 423 424 return Math.toDegrees(angle < Math.PI ? angle : 2 * Math.PI - angle); 424 425 } 425 426 426 public static double computeArea(final LatLon coord1, final LatLon coord2, final LatLon coord3) { 427 public static double computeArea(final ILatLon coord1, final ILatLon coord2, final ILatLon coord3) { 427 428 final double a = coord1.greatCircleDistance(coord2); 428 429 final double b = coord2.greatCircleDistance(coord3); … … 437 438 public static double R = 6378135; 438 439 439 public static double crossTrackError(final LatLon l1, final LatLon l2, final LatLon l3) { 440 public static double crossTrackError(final ILatLon l1, final ILatLon l2, final ILatLon l3) { 440 441 return R * Math.asin(sin(l1.greatCircleDistance(l2) / R) * sin(heading(l1, l2) - heading(l1, l3))); 441 442 } 442 443 443 public static double heading(final LatLon a, final LatLon b) { 444 public static double heading(final ILatLon a, final ILatLon b) { 444 445 double hd = Math.atan2(sin(toRadians(a.lon() - b.lon())) * cos(toRadians(b.lat())), 445 446 cos(toRadians(a.lat())) * sin(toRadians(b.lat())) -
Note:
See TracChangeset
for help on using the changeset viewer.