Package org.naviqore.utils.spatial
Class CartesianCoordinate
java.lang.Object
org.naviqore.utils.spatial.CartesianCoordinate
- All Implemented Interfaces:
Coordinate
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.naviqore.utils.spatial.Coordinate
Coordinate.Axis -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubledistanceTo(double x, double y) Calculates the distance to another point specified by its components.doubledistanceTo(Coordinate other) Calculates the distance to anotherCoordinateobject.booleandoubleExamples for the first component are latitude or X coordinate.doubleExamples for the first component are longitude or Y coordinate.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.naviqore.utils.spatial.Coordinate
getComponent
-
Constructor Details
-
CartesianCoordinate
public CartesianCoordinate(double x, double y)
-
-
Method Details
-
getFirstComponent
public double getFirstComponent()Description copied from interface:CoordinateExamples for the first component are latitude or X coordinate.- Specified by:
getFirstComponentin interfaceCoordinate- Returns:
- the first component of the 2D-coordinate
-
getSecondComponent
public double getSecondComponent()Description copied from interface:CoordinateExamples for the first component are longitude or Y coordinate.- Specified by:
getSecondComponentin interfaceCoordinate- Returns:
- the second component of the 2D-coordinate
-
distanceTo
public double distanceTo(double x, double y) Description copied from interface:CoordinateCalculates the distance to another point specified by its components.- Specified by:
distanceToin interfaceCoordinate
-
equals
-
toString
-