Class GeoTuple2D_F64<T extends GeoTuple2D_F64>

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Point2D_F64, Vector2D_F64

public abstract class GeoTuple2D_F64<T extends GeoTuple2D_F64> extends GeoTuple_F64<T>
Generic Tuple for geometric objects that store (x,y)
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
     
    double
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    GeoTuple2D_F64(double x, double y)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    double
    distance(double x, double y)
    Euclidean distance from the point
    double
     
    double
    distance2(double x, double y)
    Euclidean squared distance from the point
    double
     
    boolean
     
    int
    The dimensionality of space the tuple is contained in and the number of values it has.
    double
    getIdx(int index)
    Returns the value of the tuple along the specified coordinate system axis.
    int
     
    boolean
    isIdentical(double x, double y)
     
    boolean
    isIdentical(double x, double y, double tol)
     
    boolean
    isIdentical(T t, double tol)
    Checks to see if the two GeoTuple have values which are nearly the same.
    boolean
    Returns true if at least one value is NaN
    double
    Computes the Euclidean norm.
    double
    Computes the square of the Euclidean norm.
    Addition
    void
    In-place addition
    void
     
    void
    scale(double scalar)
    In-place scalar multiplication
    void
    setIdx(int index, double value)
     
    setTo(double x, double y)
     
    setTo(T src)
    Sets this equal to 'src'
    times(double scalar)
    Scalar multiplication
    void
    timesIP(double scalar)
    In-place scalar multiplication
    protected String
     
    void
    Sets all coefficients and parameters to zero, which is typically the initial state.

    Methods inherited from class georegression.struct.GeoTuple_F64

    copy, isInfinite

    Methods inherited from class georegression.struct.GeoTuple

    createNewInstance

    Methods inherited from class java.lang.Object

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

    • x

      public double x
    • y

      public double y
  • Constructor Details

    • GeoTuple2D_F64

      protected GeoTuple2D_F64(double x, double y)
    • GeoTuple2D_F64

      protected GeoTuple2D_F64()
  • Method Details

    • _setTo

      protected void _setTo(GeoTuple2D_F64 a)
    • setTo

      public T setTo(double x, double y)
    • zero

      public void zero()
      Description copied from class: GeoTuple
      Sets all coefficients and parameters to zero, which is typically the initial state.
      Specified by:
      zero in class GeoTuple<T extends GeoTuple2D_F64>
    • isIdentical

      public boolean isIdentical(double x, double y)
    • isIdentical

      public boolean isIdentical(double x, double y, double tol)
    • isIdentical

      public boolean isIdentical(T t, double tol)
      Description copied from class: GeoTuple_F64
      Checks to see if the two GeoTuple have values which are nearly the same. False is always returned if the dimension is different.
      Overrides:
      isIdentical in class GeoTuple_F64<T extends GeoTuple2D_F64>
      Parameters:
      t - The GeoTuple it is being compared against.
      tol - How similar each element must be for them to be considered identical.
      Returns:
      if they are identical or not.
    • plusIP

      public void plusIP(GeoTuple2D_F64 a)

      In-place addition

      this.x = this.x + a.x;
      Parameters:
      a - value which is to be added
    • plus

      public T plus(GeoTuple2D_F64 a)

      Addition

      ret.x = this.x + a.x;
      Parameters:
      a - value which is to be added
    • timesIP

      public void timesIP(double scalar)
      In-place scalar multiplication
      Parameters:
      scalar - value that it is multiplied by
    • scale

      public void scale(double scalar)
      In-place scalar multiplication
      Parameters:
      scalar - value that it is multiplied by
    • times

      public T times(double scalar)
      Scalar multiplication
      Parameters:
      scalar - value which is it multiplied by
      Returns:
      new matrix which is the original scaled
    • distance

      public double distance(double x, double y)
      Euclidean distance from the point
      Parameters:
      x - x-coordinate
      y - y-coordinate
      Returns:
      distance
    • distance2

      public double distance2(double x, double y)
      Euclidean squared distance from the point
      Parameters:
      x - x-coordinate
      y - y-coordinate
      Returns:
      distance squared
    • setTo

      public T setTo(T src)
      Description copied from class: GeoTuple
      Sets this equal to 'src'
      Specified by:
      setTo in class GeoTuple<T extends GeoTuple2D_F64>
      Parameters:
      src - The tuple being copied
      Returns:
      Reference to 'this' class instance. Used to chain operations.
    • distance

      public double distance(T t)
      Overrides:
      distance in class GeoTuple_F64<T extends GeoTuple2D_F64>
    • distance2

      public double distance2(T t)
      Overrides:
      distance2 in class GeoTuple_F64<T extends GeoTuple2D_F64>
    • getIdx

      public double getIdx(int index)
      Description copied from class: GeoTuple_F64
      Returns the value of the tuple along the specified coordinate system axis.
      Specified by:
      getIdx in class GeoTuple_F64<T extends GeoTuple2D_F64>
      Parameters:
      index - Which axis in the coordinate system.
      Returns:
      Its value.
    • setIdx

      public void setIdx(int index, double value)
      Specified by:
      setIdx in class GeoTuple_F64<T extends GeoTuple2D_F64>
    • norm

      public double norm()
      Description copied from class: GeoTuple_F64
      Computes the Euclidean norm.
      Overrides:
      norm in class GeoTuple_F64<T extends GeoTuple2D_F64>
      Returns:
      norm.
    • normSq

      public double normSq()
      Description copied from class: GeoTuple_F64
      Computes the square of the Euclidean norm.
      Overrides:
      normSq in class GeoTuple_F64<T extends GeoTuple2D_F64>
      Returns:
      norm squared.
    • getDimension

      public int getDimension()
      Description copied from class: GeoTuple
      The dimensionality of space the tuple is contained in and the number of values it has.
      Specified by:
      getDimension in class GeoTuple<T extends GeoTuple2D_F64>
      Returns:
      Dimensionality of the object.
    • print

      public void print()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class GeoTuple_F64<T extends GeoTuple2D_F64>
    • isNaN

      public boolean isNaN()
      Description copied from class: GeoTuple_F64
      Returns true if at least one value is NaN
      Overrides:
      isNaN in class GeoTuple_F64<T extends GeoTuple2D_F64>
    • toString

      protected String toString(String name)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class GeoTuple_F64<T extends GeoTuple2D_F64>