Class Point3f

Object
Tuple3f
Point3f
All Implemented Interfaces:
Serializable

public final class Point3f extends Tuple3f
A three-dimensional point of float values.

We consider a point to be a tuple representing a single physical point in space.

Author:
Owen Feehan
See Also:
  • Constructor Details

    • Point3f

      public Point3f()
      Creates the points with a 0 in each dimension.
    • Point3f

      public Point3f(Point3f point)
      Creates with the same values as an existing Point3f.
      Parameters:
      point - to copy values from.
    • Point3f

      public Point3f(float x, float y, float z)
      Create with values for each dimension.
      Parameters:
      x - the value for the X-dimension.
      y - the value for the Y-dimension.
      z - the value for the Z-dimension.
  • Method Details

    • distance

      public final double distance(Point3f point)
      The Euclidean distance between this point and another.
      Parameters:
      point - the other point to a measure a distance to.
      Returns:
      the distance.
    • distanceSquared

      public float distanceSquared(Point3f point)
      The square of the Euclidean distance between this point and another.
      Parameters:
      point - the other point to a measure a distance to.
      Returns:
      the distance squared.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Tuple3f
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class Tuple3f
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Tuple3f