Class Cursor2D

java.lang.Object
inra.ijpb.data.Cursor2D

public class Cursor2D
extends java.lang.Object
A simple class to record the coordinates a pixel in a 2D image.
See Also:
Cursor3D
  • Constructor Summary

    Constructors
    Constructor Description
    Cursor2D​(int x, int y)
    Creates a new cursor from two coordinates.
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object other)  
    double euclideanDistance​(Cursor2D c)
    Calculate Euclidean distance to another cursor
    int getX()  
    int getY()  
    void set​(int x, int y)
    Sets the position of this cursor.

    Methods inherited from class java.lang.Object

    getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Cursor2D

      public Cursor2D​(int x, int y)
      Creates a new cursor from two coordinates.
      Parameters:
      x - the x-coordinate
      y - the y-coordinate
  • Method Details

    • set

      public void set​(int x, int y)
      Sets the position of this cursor.
      Parameters:
      x - the new x-coordinate
      y - the new y-coordinate
    • getX

      public int getX()
      Returns:
      the x-position of this cursor
    • getY

      public int getY()
      Returns:
      the y-position of this cursor
    • equals

      public boolean equals​(java.lang.Object other)
      Overrides:
      equals in class java.lang.Object
    • euclideanDistance

      public double euclideanDistance​(Cursor2D c)
      Calculate Euclidean distance to another cursor
      Parameters:
      c - cursor to calculate distance to
      Returns:
      Euclidean distance between this cursor and the input one