org.openstreetmap.josm.data.coor
Class EastNorth

java.lang.Object
  extended by java.awt.geom.Point2D
      extended by org.openstreetmap.josm.data.coor.Coordinate
          extended by org.openstreetmap.josm.data.coor.EastNorth
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class EastNorth
extends Coordinate

Northing, Easting of the projected coordinates. This class is immutable.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Point2D
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
 
Field Summary
 
Fields inherited from class org.openstreetmap.josm.data.coor.Coordinate
x, y
 
Constructor Summary
EastNorth(double east, double north)
           
 
Method Summary
 EastNorth add(double dx, double dy)
           
 EastNorth add(EastNorth other)
           
 double distance(EastNorth en2)
           
 double east()
           
 boolean equalsEpsilon(EastNorth other, double e)
          Compares two EastNorth values
 EastNorth getCenter(EastNorth en2)
           
 double heading(EastNorth other)
          Returns the heading, in radians, that you have to use to get from this EastNorth to another.
 EastNorth interpolate(EastNorth en2, double proportion)
           
 boolean isValid()
          Replies true if east and north are different from Double.NaN
 double north()
           
 EastNorth rotate(EastNorth pivot, double angle)
          Returns an EastNorth representing the this EastNorth rotated around a given EastNorth by a given angle
 EastNorth scale(double s)
           
 EastNorth sub(EastNorth en)
           
 java.lang.String toString()
           
 
Methods inherited from class org.openstreetmap.josm.data.coor.Coordinate
equals, getX, getY, hashCode, setLocation
 
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, setLocation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EastNorth

public EastNorth(double east,
                 double north)
Method Detail

east

public double east()

north

public double north()

add

public EastNorth add(double dx,
                     double dy)

add

public EastNorth add(EastNorth other)

scale

public EastNorth scale(double s)

interpolate

public EastNorth interpolate(EastNorth en2,
                             double proportion)

getCenter

public EastNorth getCenter(EastNorth en2)

distance

public double distance(EastNorth en2)

heading

public double heading(EastNorth other)
Returns the heading, in radians, that you have to use to get from this EastNorth to another. Heading is mapped into [0, 2pi)

Parameters:
other - the "destination" position
Returns:
heading

isValid

public boolean isValid()
Replies true if east and north are different from Double.NaN

Returns:
true if east and north are different from Double.NaN

sub

public EastNorth sub(EastNorth en)

rotate

public EastNorth rotate(EastNorth pivot,
                        double angle)
Returns an EastNorth representing the this EastNorth rotated around a given EastNorth by a given angle

Parameters:
pivot - the center of the rotation
angle - the angle of the rotation
Returns:
EastNorth rotated object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equalsEpsilon

public boolean equalsEpsilon(EastNorth other,
                             double e)
Compares two EastNorth values

Returns:
true if "x" and "y" values are within 1E-6 of each other


JOSM