public class EastNorth extends Coordinate
| Modifier and Type | Field and Description |
|---|---|
private static long |
serialVersionUID |
static EastNorth |
ZERO
A zero constant
|
x, y| Constructor and Description |
|---|
EastNorth(double east,
double north)
Constructs a new
EastNorth. |
| Modifier and Type | Method and Description |
|---|---|
EastNorth |
add(double dEast,
double dNorth)
Adds an offset to this
EastNorth instance and returns the result. |
EastNorth |
add(EastNorth other)
Adds the coordinates of an other EastNorth instance to this one.
|
double |
distance(EastNorth en)
Returns the euclidean distance from this
EastNorth to a specified EastNorth. |
double |
distanceSq(EastNorth en)
Returns the square of the euclidean distance from this
EastNorth to a specified EastNorth. |
double |
east()
Returns easting.
|
boolean |
equalsEpsilon(EastNorth other,
double e)
Compares two EastNorth values
|
EastNorth |
getCenter(EastNorth en2)
Gets the center between two
EastNorth instances. |
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)
Does a linear interpolation between two EastNorth instances.
|
boolean |
isValid()
Replies true if east and north are different from Double.NaN and not infinite
|
double |
length()
Counts length (distance from [0,0]) of this.
|
double |
north()
Returns northing.
|
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)
Scales this
EastNorth instance to a given factor and returns the result. |
EastNorth |
subtract(EastNorth other)
Subtracts an east/north value from this point.
|
java.lang.String |
toString() |
distance, distance, distanceSq, distanceSq, equals, getX, getY, hashCodeprivate static final long serialVersionUID
public EastNorth(double east, double north)
EastNorth.east - eastingnorth - northingpublic double east()
public double north()
public EastNorth add(double dEast, double dNorth)
EastNorth instance and returns the result.dEast - The offset to add in east direction.dNorth - The offset to add in north direction.public EastNorth add(EastNorth other)
other - The other instance.public EastNorth subtract(EastNorth other)
other - The other value to subtract from this.public EastNorth scale(double s)
EastNorth instance to a given factor and returns the result.s - factorpublic EastNorth interpolate(EastNorth en2, double proportion)
en2 - The other EstNort instance.proportion - The proportion the other instance influences the result.EastNorth position.public EastNorth getCenter(EastNorth en2)
EastNorth instances.en2 - The other instance.public double distance(EastNorth en)
EastNorth to a specified EastNorth.en - the specified coordinate to be measured against this EastNorthEastNorth to a specified EastNorthpublic double distanceSq(EastNorth en)
EastNorth to a specified EastNorth.en - the specified coordinate to be measured against this EastNorthEastNorth to a specified EastNorthpublic double length()
public double heading(EastNorth other)
other - the "destination" positionpublic boolean isValid()
public EastNorth rotate(EastNorth pivot, double angle)
pivot - the center of the rotationangle - the angle of the rotationpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equalsEpsilon(EastNorth other, double e)
other - other east.northe - epsilone of each other