Class EastNorth

  • All Implemented Interfaces:
    java.io.Serializable

    public class EastNorth
    extends Coordinate
    Northing, Easting of the projected coordinates. This class is immutable.
    See Also:
    Serialized Form
    • Constructor Detail

      • EastNorth

        public EastNorth​(double east,
                         double north)
        Constructs a new EastNorth.
        Parameters:
        east - easting
        north - northing
    • Method Detail

      • east

        public double east()
        Returns easting.
        Returns:
        easting
      • north

        public double north()
        Returns northing.
        Returns:
        northing
      • add

        public EastNorth add​(double dEast,
                             double dNorth)
        Adds an offset to this EastNorth instance and returns the result.
        Parameters:
        dEast - The offset to add in east direction.
        dNorth - The offset to add in north direction.
        Returns:
        The result.
      • add

        public EastNorth add​(EastNorth other)
        Adds the coordinates of another EastNorth instance to this one.
        Parameters:
        other - The other instance.
        Returns:
        The new EastNorth position.
      • subtract

        public EastNorth subtract​(EastNorth other)
        Subtracts an east/north value from this point.
        Parameters:
        other - The other value to subtract from this.
        Returns:
        A point with the new coordinates.
      • scale

        public EastNorth scale​(double s)
        Scales this EastNorth instance to a given factor and returns the result.
        Parameters:
        s - factor
        Returns:
        The result.
      • interpolate

        public EastNorth interpolate​(EastNorth en2,
                                     double proportion)
        Does a linear interpolation between two EastNorth instances.
        Parameters:
        en2 - The other EstNort instance.
        proportion - The proportion the other instance influences the result.
        Returns:
        The new EastNorth position.
      • getCenter

        public EastNorth getCenter​(EastNorth en2)
        Gets the center between two EastNorth instances.
        Parameters:
        en2 - The other instance.
        Returns:
        The center between this and the other instance.
      • distance

        public double distance​(EastNorth en)
        Returns the euclidean distance from this EastNorth to a specified EastNorth.
        Parameters:
        en - the specified coordinate to be measured against this EastNorth
        Returns:
        the euclidean distance from this EastNorth to a specified EastNorth
        Since:
        6166
      • distanceSq

        public double distanceSq​(EastNorth en)
        Returns the square of the euclidean distance from this EastNorth to a specified EastNorth.
        Parameters:
        en - the specified coordinate to be measured against this EastNorth
        Returns:
        the square of the euclidean distance from this EastNorth to a specified EastNorth
        Since:
        6166
      • length

        public double length()
        Counts length (distance from [0,0]) of this.
        Returns:
        length of this
      • heading

        public double heading​(EastNorth other)
        Returns the heading, in radians, that you have to use to get from this EastNorth to another. Heading is mapped into [0, 2pi)
        Parameters:
        other - the "destination" position
        Returns:
        heading
      • heading

        public double heading​(EastNorth other,
                              double refHeading)
        Behaves exactly like heading(EastNorth) if refHeading is 0.0, otherwise gives a heading not relative to north (0.0). It replies the radians needed to add to refHeading to get from this EastNorth to another.
        Parameters:
        other - the "destination" position
        refHeading - origin ("false" north if different from 0.0)
        Returns:
        heading with respect to refHeading as origin
        Since:
        18468
      • isValid

        public boolean isValid()
        Replies true if east and north are different from Double.NaN and not infinite
        Returns:
        true if east and north are different from Double.NaN and not infinite
      • rotate

        public EastNorth rotate​(EastNorth pivot,
                                double angle)
        Returns an EastNorth representing this EastNorth rotated around a given EastNorth by a given angle
        Parameters:
        pivot - the center of the rotation
        angle - the angle of the rotation
        Returns:
        EastNorth rotated object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equalsEpsilon

        public boolean equalsEpsilon​(EastNorth other,
                                     double e)
        Compares two EastNorth values
        Parameters:
        other - other east.north
        e - epsilon
        Returns:
        true if "x" and "y" values are within epsilon e of each other