abstract class Coordinate extends java.lang.Object implements java.io.Serializable
Constructor and Description |
---|
Coordinate(double x,
double y)
Construct the point with latitude / longitude values.
|
Modifier and Type | Method and Description |
---|---|
protected double |
distance(Coordinate coor)
Returns the euclidean distance from this
Coordinate to a specified Coordinate . |
double |
distance(double px,
double py)
Returns the euclidean distance from this
Coordinate to a specified coordinate. |
protected double |
distanceSq(Coordinate coor)
Returns the square of the euclidean distance from this
Coordinate to a specified Coordinate . |
double |
distanceSq(double px,
double py)
Returns the square of euclidean distance from this
Coordinate to a specified coordinate. |
boolean |
equals(java.lang.Object obj) |
double |
getX() |
double |
getY() |
int |
hashCode() |
Coordinate(double x, double y)
x
- X coordinate of the point.y
- Y coordinate of the point.public double getX()
public double getY()
protected final double distance(Coordinate coor)
Coordinate
to a specified Coordinate
.coor
- the specified coordinate to be measured against this Coordinate
Coordinate
to a specified Coordinate
public final double distance(double px, double py)
Coordinate
to a specified coordinate.px
- the X coordinate of the specified point to be measured against this Coordinate
py
- the Y coordinate of the specified point to be measured against this Coordinate
Coordinate
to a specified coordinateprotected final double distanceSq(Coordinate coor)
Coordinate
to a specified Coordinate
.coor
- the specified coordinate to be measured against this Coordinate
Coordinate
to a specified Coordinate
public final double distanceSq(double px, double py)
Coordinate
to a specified coordinate.px
- the X coordinate of the specified point to be measured against this Coordinate
py
- the Y coordinate of the specified point to be measured against this Coordinate
Coordinate
to a specified coordinatepublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object