Changeset 14521 in josm for trunk/src/org
- Timestamp:
- 2018-12-08T14:19:23+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Bounds.java
r14095 r14521 500 500 */ 501 501 public Rectangle2D.Double asRect() { 502 double w = getWidth(); 503 return new Rectangle2D.Double(minLon, minLat, w, maxLat-minLat); 504 } 505 506 private double getWidth() { 502 return new Rectangle2D.Double(minLon, minLat, getWidth(), getHeight()); 503 } 504 505 /** 506 * Returns the bounds width. 507 * @return the bounds width 508 * @since 14521 509 */ 510 public double getHeight() { 511 return maxLat-minLat; 512 } 513 514 /** 515 * Returns the bounds width. 516 * @return the bounds width 517 * @since 14521 518 */ 519 public double getWidth() { 507 520 return maxLon-minLon + (crosses180thMeridian() ? 360.0 : 0.0); 508 521 } … … 513 526 */ 514 527 public double getArea() { 515 return getWidth() * (maxLat - minLat);528 return getWidth() * getHeight(); 516 529 } 517 530 -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r14273 r14521 840 840 BigDecimal east = BigDecimal.ZERO; 841 841 842 // See https://en.wikipedia.org/wiki/Centroid# Centroid_of_a_polygon for the equation used here842 // See https://en.wikipedia.org/wiki/Centroid#Of_a_polygon for the equation used here 843 843 for (int i = 0; i < size; i++) { 844 844 EastNorth n0 = nodes.get(i);
Note:
See TracChangeset
for help on using the changeset viewer.