public class Point extends Object
Constructor and Description |
---|
Point()
Constructs and initializes a point at the (0,0) location in the coordinate space.
|
Point(float xCoord,
float yCoord)
Constructs and initializes a point at the specified (xCoord,yCoord) location in the
coordinate space.
|
Point(int xCoord,
int yCoord)
Constructs and initializes a point at the specified (xCoord,yCoord) location in the
coordinate space.
|
Point(Point p)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
static float |
distance(float deltaX,
float deltaY) |
static float |
distance(float x1,
float y1,
float x2,
float y2)
Convenience wrapper function that simply returns
Point.distance(new
Point(x1, y1), new Point(x2, y2)) . |
static float |
distance(int x1,
int y1,
int x2,
int y2)
Convenience wrapper function that simply returns
Point.distance(new
Point(x1, y1), new Point(x2, y2)) . |
static float |
distance(Point p1,
Point p2)
Returns the Euclidean distance between points p1 and p2.
|
boolean |
equals(Object obj) |
int |
hashCode() |
void |
set(float xCoord,
float yCoord)
Sets the (x,y) coordinates of this point from the given single float precision
(xCoord,yCoord) coordinates.
|
void |
set(int xCoord,
int yCoord)
Sets the (x,y) coordinates of this point from the given (xCoord,yCoord) coordinates.
|
void |
setX(int xVal) |
void |
setY(int yVal) |
int |
x()
Returns the x coordinate of the point.
|
int |
y()
Returns the y coordinate of the point.
|
public Point()
public Point(Point p)
p
- the point to be copiedpublic Point(int xCoord, int yCoord)
public Point(float xCoord, float yCoord)
public void set(int xCoord, int yCoord)
public void set(float xCoord, float yCoord)
public int x()
public int y()
public void setX(int xVal)
public void setY(int yVal)
public static float distance(int x1, int y1, int x2, int y2)
Point.distance(new
Point(x1, y1), new Point(x2, y2))
.distance(Point, Point)
public static float distance(float x1, float y1, float x2, float y2)
Point.distance(new
Point(x1, y1), new Point(x2, y2))
.distance(Point, Point)
public static float distance(Point p1, Point p2)
public static float distance(float deltaX, float deltaY)
Processing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia