Changeset 9565 in josm for trunk/src/org/openstreetmap/josm/data/projection/Ellipsoid.java
- Timestamp:
- 2016-01-22T16:50:40+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/Ellipsoid.java
r9419 r9565 132 132 133 133 /** 134 * if ellipsoid is spherical, i.e. the major and minor semiaxis are 135 * the same 136 */ 137 public final boolean spherical; 138 139 /** 134 140 * private constructur - use one of the create_* methods 135 141 * … … 139 145 * @param e2 first eccentricity squared 140 146 * @param eb2 square of the second eccentricity 141 */ 142 private Ellipsoid(double a, double b, double e, double e2, double eb2) { 147 * @param sperical if the ellipsoid is sphere 148 */ 149 private Ellipsoid(double a, double b, double e, double e2, double eb2, boolean sperical) { 143 150 this.a = a; 144 151 this.b = b; … … 146 153 this.e2 = e2; 147 154 this.eb2 = eb2; 155 this.spherical = sperical; 148 156 } 149 157 … … 159 167 double e = Math.sqrt(e2); 160 168 double eb2 = e2 / (1.0 - e2); 161 return new Ellipsoid(a, b, e, e2, eb2 );169 return new Ellipsoid(a, b, e, e2, eb2, a == b); 162 170 } 163 171 … … 173 181 double e = Math.sqrt(es); 174 182 double eb2 = es / (1.0 - es); 175 return new Ellipsoid(a, b, e, es, eb2 );183 return new Ellipsoid(a, b, e, es, eb2, es == 0); 176 184 } 177 185 … … 188 196 double e = Math.sqrt(e2); 189 197 double eb2 = e2 / (1.0 - e2); 190 return new Ellipsoid(a, b, e, e2, eb2 );198 return new Ellipsoid(a, b, e, e2, eb2, f == 0); 191 199 } 192 200 … … 334 342 return new LatLon(Math.toDegrees(lt), Math.toDegrees(lg)); 335 343 } 336 344 337 345 /** 338 346 * convert ellipsoidal coordinates to cartesian coordinates
Note:
See TracChangeset
for help on using the changeset viewer.