Ignore:
Timestamp:
2013-08-22T00:33:32+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #8987 - immutable coordinates (patch by shinigami)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java

    r6169 r6173  
    99 * @author Imi
    1010 */
    11 public class EastNorth extends Coordinate implements Cloneable {
     11public class EastNorth extends Coordinate {
    1212
    1313    public EastNorth(double east, double north) {
     
    3737    public EastNorth interpolate(EastNorth en2, double proportion) {
    3838        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));
    4040    }
    4141
     
    5454        return super.distance(en);
    5555    }
    56    
     56
    5757    /**
    5858     * Returns the square of the euclidean distance from this {@code EastNorth} to a specified {@code EastNorth}.
     
    7474        return Math.sqrt(x*x + y*y);
    7575    }
    76    
     76
    7777    /**
    7878     * Returns the heading, in radians, that you have to use to get from
     
    8484    public double heading(EastNorth other) {
    8585        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        }
    8789        return hd;
    8890    }
     
    130132        return (Math.abs(x - other.x) < e && Math.abs(y - other.y) < e);
    131133    }
    132 
    133     @Override
    134     public EastNorth clone() throws CloneNotSupportedException {
    135         return (EastNorth) super.clone();
    136     }
    137134}
Note: See TracChangeset for help on using the changeset viewer.