Package io.guise.framework.geometry
Class Point
java.lang.Object
io.guise.framework.geometry.Point
A point in three-dimensional space.
- Author:
- Garret Wilson
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPoint
(double x, double y) Two-dimensional primitive pixel coordinate constructor.Point
(double x, double y, double z) Primitive pixel coordinate constructor.Primitive coordinate and unit constructor.Two-dimensional primitive coordinate and unit constructor.Two-dimensional coordinate constructor.Coordinate constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getX()
getY()
getZ()
int
hashCode()
final String
toString()
translate
(double dx, double dy) Translates this point in two dimensions by the given primitive coordinate deltas.translate
(double dx, double dy, double dz) Translates this point by the given primitive coordinate deltas.translate
(Dimensions dimensions) Translates this point by the given dimensions.Translates this point in two dimensions by the given coordinate deltas.Translates this point by the given coordinate deltas.
-
Field Details
-
ORIGIN_POINT
A predefined point with zero coordinates.
-
-
Constructor Details
-
Point
public Point(double x, double y) Two-dimensional primitive pixel coordinate constructor.- Parameters:
x
- The X coordinate.y
- The Y coordinate.
-
Point
public Point(double x, double y, double z) Primitive pixel coordinate constructor.- Parameters:
x
- The X coordinate.y
- The Y coordinate.z
- The Z coordinate.
-
Point
Two-dimensional primitive coordinate and unit constructor.- Parameters:
x
- The X coordinate.y
- The Y coordinate.unit
- The unit in which the point is measured.
-
Point
Primitive coordinate and unit constructor.- Parameters:
x
- The X coordinate.y
- The Y coordinate.z
- The Z coordinate.unit
- The unit in which the point is measured.
-
Point
Two-dimensional coordinate constructor.- Parameters:
x
- The X coordinate.y
- The Y coordinate.- Throws:
NullPointerException
- if one of the given coordinates isnull
.
-
Point
Coordinate constructor.- Parameters:
x
- The X coordinate.y
- The Y coordinate.z
- The Z coordinate.- Throws:
NullPointerException
- if one of the given coordinates isnull
.
-
-
Method Details
-
getX
- Returns:
- The X coordinate.
-
getY
- Returns:
- The Y coordinate.
-
getZ
- Returns:
- The Z coordinate.
-
translate
Translates this point in two dimensions by the given coordinate deltas.- Parameters:
dx
- The X coordinate delta.dy
- The Y coordinate delta.- Returns:
- A new point translated by the given deltas.
-
translate
Translates this point by the given coordinate deltas.- Parameters:
dx
- The X coordinate delta.dy
- The Y coordinate delta.dz
- The Z coordinate delta.- Returns:
- A new point translated by the given deltas.
-
translate
Translates this point in two dimensions by the given primitive coordinate deltas.- Parameters:
dx
- The X coordinate delta.dy
- The Y coordinate delta.- Returns:
- A new point translated by the given deltas.
-
translate
Translates this point by the given primitive coordinate deltas.- Parameters:
dx
- The X coordinate delta.dy
- The Y coordinate delta.dz
- The Z coordinate delta.- Returns:
- A new point translated by the given deltas.
-
translate
Translates this point by the given dimensions.- Parameters:
dimensions
- The dimension by which to translate this point- Returns:
- A new point translated by the given dimensions.
-
hashCode
public int hashCode() -
equals
This implementation returns whether the object is another point with equivalent coordinates.
-
toString
-