Package org.openstreetmap.josm.data.coor
Class Coordinate
java.lang.Object
org.openstreetmap.josm.data.coor.Coordinate
- All Implemented Interfaces:
Serializable
Base class of points of both coordinate systems.
The variables are default package protected to allow routines in the
data package to access them directly.
As the class itself is package protected too, it is not visible
outside of the data package. Routines there should only use LatLon or
EastNorth.
- Since:
- 6162
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCoordinate(double x, double y) Construct the point with latitude / longitude values. -
Method Summary
Modifier and TypeMethodDescriptionfinal doubledistance(double px, double py) Returns the euclidean distance from thisCoordinateto a specified coordinate.protected final doubledistance(Coordinate coor) Returns the euclidean distance from thisCoordinateto a specifiedCoordinate.final doubledistanceSq(double px, double py) Returns the square of euclidean distance from thisCoordinateto a specified coordinate.protected final doubledistanceSq(Coordinate coor) Returns the square of the euclidean distance from thisCoordinateto a specifiedCoordinate.booleandoublegetX()doublegetY()inthashCode()
-
Field Details
-
x
-
y
-
-
Constructor Details
-
Coordinate
Coordinate(double x, double y) Construct the point with latitude / longitude values.- Parameters:
x- X coordinate of the point.y- Y coordinate of the point.
-
-
Method Details
-
getX
-
getY
-
distance
Returns the euclidean distance from thisCoordinateto a specifiedCoordinate.- Parameters:
coor- the specified coordinate to be measured against thisCoordinate- Returns:
- the euclidean distance from this
Coordinateto a specifiedCoordinate - Since:
- 6166
-
distance
Returns the euclidean distance from thisCoordinateto a specified coordinate.- Parameters:
px- the X coordinate of the specified point to be measured against thisCoordinatepy- the Y coordinate of the specified point to be measured against thisCoordinate- Returns:
- the euclidean distance from this
Coordinateto a specified coordinate - Since:
- 6166
-
distanceSq
Returns the square of the euclidean distance from thisCoordinateto a specifiedCoordinate.- Parameters:
coor- the specified coordinate to be measured against thisCoordinate- Returns:
- the square of the euclidean distance from this
Coordinateto a specifiedCoordinate - Since:
- 6166
-
distanceSq
Returns the square of euclidean distance from thisCoordinateto a specified coordinate.- Parameters:
px- the X coordinate of the specified point to be measured against thisCoordinatepy- the Y coordinate of the specified point to be measured against thisCoordinate- Returns:
- the square of the euclidean distance from this
Coordinateto a specified coordinate - Since:
- 6166
-
hashCode
-
equals
-