Class Point

java.lang.Object
io.guise.framework.geometry.Point

public class Point extends Object
A point in three-dimensional space.
Author:
Garret Wilson
  • Field Details

    • ORIGIN_POINT

      public static final Point 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

      public Point(double x, double y, Unit unit)
      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

      public Point(double x, double y, double z, Unit unit)
      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

      public Point(Extent x, Extent y)
      Two-dimensional coordinate constructor.
      Parameters:
      x - The X coordinate.
      y - The Y coordinate.
      Throws:
      NullPointerException - if one of the given coordinates is null.
    • Point

      public Point(Extent x, Extent y, Extent z)
      Coordinate constructor.
      Parameters:
      x - The X coordinate.
      y - The Y coordinate.
      z - The Z coordinate.
      Throws:
      NullPointerException - if one of the given coordinates is null.
  • Method Details

    • getX

      public Extent getX()
      Returns:
      The X coordinate.
    • getY

      public Extent getY()
      Returns:
      The Y coordinate.
    • getZ

      public Extent getZ()
      Returns:
      The Z coordinate.
    • translate

      public Point translate(Extent dx, Extent dy)
      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

      public Point translate(Extent dx, Extent dy, Extent dz)
      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

      public Point translate(double dx, double dy)
      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

      public Point translate(double dx, double dy, double dz)
      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

      public Point translate(Dimensions dimensions)
      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()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)

      This implementation returns whether the object is another point with equivalent coordinates.

      Overrides:
      equals in class Object
    • toString

      public final String toString()
      Overrides:
      toString in class Object