Changeset 6166 in josm for trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
- Timestamp:
- 2013-08-21T02:04:20+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r6162 r6166 27 27 */ 28 28 public class LatLon extends Coordinate { 29 30 29 31 30 /** … … 298 297 299 298 /** 300 * Counts euclidean distance between this and other LatLon.299 * Returns the euclidean distance from this {@code LatLon} to a specified {@code LatLon}. 301 300 * 302 * @param ll2 other LatLon 303 * @return distance between this and other LatLon 304 */ 305 public double distance(final LatLon ll2) { 306 final double dx = this.x-ll2.x; 307 final double dy = this.y-ll2.y; 308 return Math.sqrt(dx*dx + dy*dy); 309 } 310 301 * @param ll the specified coordinate to be measured against this {@code LatLon} 302 * @return the euclidean distance from this {@code LatLon} to a specified {@code LatLon} 303 * @since 6166 304 */ 305 public double distance(final LatLon ll) { 306 return super.distance(ll); 307 } 308 309 /** 310 * Returns the square of the euclidean distance from this {@code LatLon} to a specified {@code LatLon}. 311 * 312 * @param ll the specified coordinate to be measured against this {@code LatLon} 313 * @return the square of the euclidean distance from this {@code LatLon} to a specified {@code LatLon} 314 * @since 6166 315 */ 316 public double distanceSq(final LatLon ll) { 317 return super.distanceSq(ll); 318 } 319 311 320 @Override public String toString() { 312 321 return "LatLon[lat="+lat()+",lon="+lon()+"]";
Note:
See TracChangeset
for help on using the changeset viewer.