org.openstreetmap.josm.data.coor
Class EastNorth
java.lang.Object
java.awt.geom.Point2D
org.openstreetmap.josm.data.coor.Coordinate
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 classes/interfaces inherited from class java.awt.geom.Point2D |
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float |
Fields inherited from class org.openstreetmap.josm.data.coor.Coordinate |
x, y |
Constructor Summary |
EastNorth(double east,
double north)
|
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 |
EastNorth
public EastNorth(double east,
double north)
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 rotationangle
- 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