Changeset 1990 in josm for trunk/src/org/openstreetmap/josm/data/coor
 Timestamp:
 20090823T22:37:39+02:00 (10 years ago)
 Location:
 trunk/src/org/openstreetmap/josm/data/coor
 Files:

 1 added
 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r1789 r1990 25 25 private static DecimalFormat cDdFormatter = new DecimalFormat("###0.0000"); 26 26 27 /**28 * Possible ways to display coordinates29 */30 public enum CoordinateFormat {31 DECIMAL_DEGREES {public String toString() {return tr("Decimal Degrees");}},32 DEGREES_MINUTES_SECONDS {public String toString() {return tr("Degrees Minutes Seconds");}};33 }34 27 35 28 public static String dms(double pCoordinate) { … … 42 35 43 36 return tDegree + "\u00B0" + cDmsMinuteFormatter.format(tMinutes) + "\'" 44 37 + cDmsSecondFormatter.format(tSeconds) + "\""; 45 38 } 46 39 … … 94 87 Bounds b = Main.proj.getWorldBoundsLatLon(); 95 88 return lat() < b.min.lat()  lat() > b.max.lat()  96 89 lon() < b.min.lon()  lon() > b.max.lon(); 97 90 } 98 91 … … 112 105 public double greatCircleDistance(LatLon other) { 113 106 return (Math.acos( 114 Math.sin(Math.toRadians(lat())) * Math.sin(Math.toRadians(other.lat())) +115 Math.cos(Math.toRadians(lat()))*Math.cos(Math.toRadians(other.lat())) *116 107 Math.sin(Math.toRadians(lat())) * Math.sin(Math.toRadians(other.lat())) + 108 Math.cos(Math.toRadians(lat()))*Math.cos(Math.toRadians(other.lat())) * 109 Math.cos(Math.toRadians(other.lon()lon()))) * 6378135); 117 110 } 118 111 … … 130 123 } else { 131 124 rv = Math.atan((other.lon()lon())/(other.lat()lat())); 132 if (rv < 0) rv += Math.PI; 133 if (other.lon() < lon()) rv += Math.PI; 125 if (rv < 0) { 126 rv += Math.PI; 127 } 128 if (other.lon() < lon()) { 129 rv += Math.PI; 130 } 134 131 } 135 132 return rv; … … 149 146 public LatLon interpolate(LatLon ll2, double proportion) { 150 147 return new LatLon(this.lat() + proportion * (ll2.lat()  this.lat()), 151 this.lon() + proportion * (ll2.lon()  this.lon()));148 this.lon() + proportion * (ll2.lon()  this.lon())); 152 149 } 153 150
Note: See TracChangeset
for help on using the changeset viewer.