Changeset 608 in josm for trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java
- Timestamp:
- 17.04.2008 03:03:28 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java
r486 r608 41 41 * Return the squared distance of the northing/easting values between 42 42 * this and the argument. 43 * 44 * This method does NOT compute a great circle distance between two 45 * locations! 43 46 * 44 47 * @param other The other point to calculate the distance to. … … 46 49 * regarding to the x/y values. 47 50 */ 51 public double distanceSq(Coordinate other) { 52 return (x-other.x)*(x-other.x)+(y-other.y)*(y-other.y); 53 } 54 55 /** 56 * Return the distance of the northing/easting values between this and 57 * the argument. 58 * 59 * This method does NOT compute a great circle distance between two 60 * locations! 61 * 62 * @param other The other point to calculate the distance to. 63 * @return The square of the distance between this and the other point, 64 * regarding to the x/y values. 65 */ 48 66 public double distance(Coordinate other) { 49 return (x-other.x)*(x-other.x)+(y-other.y)*(y-other.y);67 return Math.sqrt(distanceSq(other)); 50 68 } 51 69
Note: See TracChangeset
for help on using the changeset viewer.
