Package arc.math.geom
Class Point3
java.lang.Object
arc.math.geom.Point3
A point in a 3D grid, with integer x and y coordinates
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(int x, int y, int z) Adds another 3D grid point to this point.Adds another 3D grid point to this point.cpy()
float
dst
(int x, int y, int z) float
float
dst2
(int x, int y, int z) float
boolean
int
hashCode()
set
(int x, int y, int z) Sets the coordinates of this GridPoint3D.Sets the coordinates of this 3D grid point to that of another.sub
(int x, int y, int z) Subtracts another 3D grid point from this point.Subtracts another 3D grid point from this point.toString()
-
Field Details
-
x
public int x -
y
public int y -
z
public int z
-
-
Constructor Details
-
Point3
public Point3()Constructs a 3D grid point with all coordinates pointing to the origin (0, 0, 0). -
Point3
public Point3(int x, int y, int z) Constructs a 3D grid point.- Parameters:
x
- X coordinatey
- Y coordinatez
- Z coordinate
-
Point3
Copy constructor- Parameters:
point
- The 3D grid point to make a copy of.
-
-
Method Details
-
set
Sets the coordinates of this 3D grid point to that of another.- Parameters:
point
- The 3D grid point to copy coordinates of.- Returns:
- this Point3 for chaining.
-
set
Sets the coordinates of this GridPoint3D.- Parameters:
x
- X coordinatey
- Y coordinatez
- Z coordinate- Returns:
- this GridPoint3D for chaining.
-
dst2
- Parameters:
other
- The other point- Returns:
- the squared distance between this point and the other point.
-
dst2
public float dst2(int x, int y, int z) - Parameters:
x
- The x-coordinate of the other pointy
- The y-coordinate of the other pointz
- The z-coordinate of the other point- Returns:
- the squared distance between this point and the other point.
-
dst
- Parameters:
other
- The other point- Returns:
- the distance between this point and the other vector.
-
dst
public float dst(int x, int y, int z) - Parameters:
x
- The x-coordinate of the other pointy
- The y-coordinate of the other pointz
- The z-coordinate of the other point- Returns:
- the distance between this point and the other point.
-
add
Adds another 3D grid point to this point.- Parameters:
other
- The other point- Returns:
- this 3d grid point for chaining.
-
add
Adds another 3D grid point to this point.- Parameters:
x
- The x-coordinate of the other pointy
- The y-coordinate of the other pointz
- The z-coordinate of the other point- Returns:
- this 3d grid point for chaining.
-
sub
Subtracts another 3D grid point from this point.- Parameters:
other
- The other point- Returns:
- this 3d grid point for chaining.
-
sub
Subtracts another 3D grid point from this point.- Parameters:
x
- The x-coordinate of the other pointy
- The y-coordinate of the other pointz
- The z-coordinate of the other point- Returns:
- this 3d grid point for chaining.
-
cpy
- Returns:
- a copy of this grid point
-
equals
-
hashCode
public int hashCode() -
toString
-