public class GridPoint2 extends Object implements Serializable
Constructor and Description |
---|
GridPoint2()
Constructs a new 2D grid point.
|
GridPoint2(GridPoint2 point)
Copy constructor
|
GridPoint2(int x,
int y)
Constructs a new 2D grid point.
|
Modifier and Type | Method and Description |
---|---|
GridPoint2 |
add(GridPoint2 other)
Adds another 2D grid point to this point.
|
GridPoint2 |
add(int x,
int y)
Adds another 2D grid point to this point.
|
GridPoint2 |
cpy() |
float |
dst(GridPoint2 other) |
float |
dst(int x,
int y) |
float |
dst2(GridPoint2 other) |
float |
dst2(int x,
int y) |
boolean |
equals(Object o) |
int |
hashCode() |
GridPoint2 |
set(GridPoint2 point)
Sets the coordinates of this 2D grid point to that of another.
|
GridPoint2 |
set(int x,
int y)
Sets the coordinates of this 2D grid point.
|
GridPoint2 |
sub(GridPoint2 other)
Subtracts another 2D grid point from this point.
|
GridPoint2 |
sub(int x,
int y)
Subtracts another 2D grid point from this point.
|
String |
toString() |
public GridPoint2()
public GridPoint2(int x, int y)
x
- X coordinatey
- Y coordinatepublic GridPoint2(GridPoint2 point)
point
- The 2D grid point to make a copy of.public GridPoint2 set(GridPoint2 point)
point
- The 2D grid point to copy the coordinates of.public GridPoint2 set(int x, int y)
x
- X coordinatey
- Y coordinatepublic float dst2(GridPoint2 other)
other
- The other pointpublic float dst2(int x, int y)
x
- The x-coordinate of the other pointy
- The y-coordinate of the other pointpublic float dst(GridPoint2 other)
other
- The other pointpublic float dst(int x, int y)
x
- The x-coordinate of the other pointy
- The y-coordinate of the other pointpublic GridPoint2 add(GridPoint2 other)
other
- The other pointpublic GridPoint2 add(int x, int y)
x
- The x-coordinate of the other pointy
- The y-coordinate of the other pointpublic GridPoint2 sub(GridPoint2 other)
other
- The other pointpublic GridPoint2 sub(int x, int y)
x
- The x-coordinate of the other pointy
- The y-coordinate of the other pointpublic GridPoint2 cpy()
Copyright © 2021. All rights reserved.