Changeset 6173 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2013-08-22T00:33:32+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/EastNorth.java
r6169 r6173 9 9 * @author Imi 10 10 */ 11 public class EastNorth extends Coordinate implements Cloneable{11 public class EastNorth extends Coordinate { 12 12 13 13 public EastNorth(double east, double north) { … … 37 37 public EastNorth interpolate(EastNorth en2, double proportion) { 38 38 return new EastNorth(this.x + proportion * (en2.x - this.x), 39 this.y + proportion * (en2.y - this.y));39 this.y + proportion * (en2.y - this.y)); 40 40 } 41 41 … … 54 54 return super.distance(en); 55 55 } 56 56 57 57 /** 58 58 * Returns the square of the euclidean distance from this {@code EastNorth} to a specified {@code EastNorth}. … … 74 74 return Math.sqrt(x*x + y*y); 75 75 } 76 76 77 77 /** 78 78 * Returns the heading, in radians, that you have to use to get from … … 84 84 public double heading(EastNorth other) { 85 85 double hd = Math.atan2(other.east() - east(), other.north() - north()); 86 if(hd < 0) hd = 2 * Math.PI + hd; 86 if(hd < 0) { 87 hd = 2 * Math.PI + hd; 88 } 87 89 return hd; 88 90 } … … 130 132 return (Math.abs(x - other.x) < e && Math.abs(y - other.y) < e); 131 133 } 132 133 @Override134 public EastNorth clone() throws CloneNotSupportedException {135 return (EastNorth) super.clone();136 }137 134 } -
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r6169 r6173 26 26 * @author Imi 27 27 */ 28 public class LatLon extends Coordinate implements Cloneable{28 public class LatLon extends Coordinate { 29 29 30 30 /** … … 158 158 } 159 159 160 p ublicLatLon(LatLon coor) {160 protected LatLon(LatLon coor) { 161 161 super(coor.lon(), coor.lat()); 162 162 } … … 222 222 223 223 /** 224 * Check if this is contained in given area or area is null. 224 * Check if this is contained in given area or area is null. 225 225 * 226 226 * @param a Area 227 * @return <code>true</code> if this is contained in given area or area is null. 227 * @return <code>true</code> if this is contained in given area or area is null. 228 228 */ 229 229 public boolean isIn(Area a) { … … 306 306 return super.distance(ll); 307 307 } 308 308 309 309 /** 310 310 * Returns the square of the euclidean distance from this {@code LatLon} to a specified {@code LatLon}. … … 317 317 return super.distanceSq(ll); 318 318 } 319 319 320 320 @Override public String toString() { 321 321 return "LatLon[lat="+lat()+",lon="+lon()+"]"; … … 395 395 return true; 396 396 } 397 398 @Override399 public LatLon clone() throws CloneNotSupportedException {400 return (LatLon) super.clone();401 }402 397 }
Note:
See TracChangeset
for help on using the changeset viewer.