Class Point


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

      Fields 
      Modifier and Type Field Description
      static Point ORIGIN_POINT
      A predefined point with zero coordinates.
    • Constructor Summary

      Constructors 
      Constructor Description
      Point​(double x, double y)
      Two-dimensional primitive pixel coordinate constructor.
      Point​(double x, double y, double z)
      Primitive pixel coordinate constructor.
      Point​(double x, double y, double z, Unit unit)
      Primitive coordinate and unit constructor.
      Point​(double x, double y, Unit unit)
      Two-dimensional primitive coordinate and unit constructor.
      Point​(Extent x, Extent y)
      Two-dimensional coordinate constructor.
      Point​(Extent x, Extent y, Extent z)
      Coordinate constructor.
    • Field Detail

      • ORIGIN_POINT

        public static final Point ORIGIN_POINT
        A predefined point with zero coordinates.
    • Constructor Detail

      • 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:
        java.lang.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:
        java.lang.NullPointerException - if one of the given coordinates is null.
    • Method Detail

      • 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 java.lang.Object
      • equals

        public boolean equals​(java.lang.Object object)

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

        Overrides:
        equals in class java.lang.Object
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object