Class Coordinate

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    EastNorth, LatLon

    abstract class Coordinate
    extends java.lang.Object
    implements java.io.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 
      Modifier and Type Field Description
      protected double x  
      protected double y  
    • Constructor Summary

      Constructors 
      Constructor Description
      Coordinate​(double x, double y)
      Construct the point with latitude / longitude values.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double distance​(double px, double py)
      Returns the euclidean distance from this Coordinate to a specified coordinate.
      protected double distance​(Coordinate coor)
      Returns 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.
      protected double distanceSq​(Coordinate coor)
      Returns the square of the euclidean distance from this Coordinate to a specified Coordinate.
      boolean equals​(java.lang.Object obj)  
      double getX()  
      double getY()  
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • x

        protected final double x
      • y

        protected final double y
    • Constructor Detail

      • 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 Detail

      • getX

        public double getX()
      • getY

        public double getY()
      • distance

        protected final double distance​(Coordinate coor)
        Returns the euclidean distance from this Coordinate to a specified Coordinate.
        Parameters:
        coor - the specified coordinate to be measured against this Coordinate
        Returns:
        the euclidean distance from this Coordinate to a specified Coordinate
        Since:
        6166
      • distance

        public final double distance​(double px,
                                     double py)
        Returns the euclidean distance from this Coordinate to a specified coordinate.
        Parameters:
        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
        Returns:
        the euclidean distance from this Coordinate to a specified coordinate
        Since:
        6166
      • distanceSq

        protected final double distanceSq​(Coordinate coor)
        Returns the square of the euclidean distance from this Coordinate to a specified Coordinate.
        Parameters:
        coor - the specified coordinate to be measured against this Coordinate
        Returns:
        the square of the euclidean distance from this Coordinate to a specified Coordinate
        Since:
        6166
      • distanceSq

        public final double distanceSq​(double px,
                                       double py)
        Returns the square of euclidean distance from this Coordinate to a specified coordinate.
        Parameters:
        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
        Returns:
        the square of the euclidean distance from this Coordinate to a specified coordinate
        Since:
        6166
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object