Changeset 6165 in josm
- Timestamp:
- 2013-08-21T01:32:39+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/coor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java
r6163 r6165 14 14 * EastNorth. 15 15 * 16 * @ author imi16 * @since 6162 17 17 */ 18 18 abstract class Coordinate implements Serializable { … … 37 37 public double getY() { 38 38 return y; 39 } 40 41 /** 42 * Returns the square of the euclidean distance from this {@code Coordinate} to a specified {@code Coordinate}. 43 * 44 * @param coor the specified coordinate to be measured against this {@code Coordinate} 45 * @return the square of the euclidean distance from this {@code Coordinate} to a specified {@code Coordinate} 46 */ 47 public double distanceSq(final Coordinate coor) { 48 final double dx = this.x-coor.x; 49 final double dy = this.y-coor.y; 50 return dx*dx + dy*dy; 39 51 } 40 52 -
trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java
r6162 r6165 54 54 final double dy = this.y-en2.y; 55 55 return Math.sqrt(dx*dx + dy*dy); 56 }57 58 /**59 * Counts square of euclidean distance between this and other EastNorth.60 *61 * @param en2 other EastNorth62 * @return square of distance between this and other EastNorth63 */64 public double distanceSq(final EastNorth en2) {65 final double dx = this.x-en2.x;66 final double dy = this.y-en2.y;67 return dx*dx + dy*dy;68 56 } 69 57
Note:
See TracChangeset
for help on using the changeset viewer.