Package inra.ijpb.data
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
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-coordinatey
- the y-coordinate
-
-
Method Details
-
set
public void set(int x, int y)Sets the position of this cursor.- Parameters:
x
- the new x-coordinatey
- 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 classjava.lang.Object
-
euclideanDistance
Calculate Euclidean distance to another cursor- Parameters:
c
- cursor to calculate distance to- Returns:
- Euclidean distance between this cursor and the input one
-