| Constructor and Description |
|---|
Point2D(double x,
double y)
Create a new Point2D.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
Region |
getBoundingRegion()
Get the bounding region of this object.
|
double |
getX()
Get the X coordinate.
|
double |
getY()
Get the Y coordinate.
|
int |
hashCode() |
Vector2D |
minus(Point2D p)
Create a vector by subtracting a point from this point.
|
Point2D |
plus(Vector2D v)
Create a Point2D by adding a vector to this point.
|
java.lang.String |
toString() |
Point2D |
translate(double dx,
double dy)
Create a new Point2D that is a translation of this point.
|
public Point2D(double x,
double y)
x - The x coordinate.y - The y coordinate.public double getX()
public double getY()
public Point2D translate(double dx, double dy)
dx - The x translation.dy - The y translation.public Vector2D minus(Point2D p)
p - The Point2D to subtract from this one.public Point2D plus(Vector2D v)
v - The Vector2D to add.public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic Region getBoundingRegion()
IndexablegetBoundingRegion in interface Indexable