Class Vector3d

Object
Tuple3d
Vector3d
All Implemented Interfaces:
Serializable

public final class Vector3d extends Tuple3d
A three-dimensional vector of double values.

We consider a vector to be a tuple with additional magnitude and direction, to give a physical interpretation.

Author:
Owen Feehan
See Also:
  • Constructor Details

    • Vector3d

      public Vector3d(Tuple3d tuple)
      Creates with the same values as an existing Tuple3d.
      Parameters:
      tuple - to copy values from.
    • Vector3d

      public Vector3d(double x, double y, double 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.
    • Vector3d

      public Vector3d()
  • Method Details

    • crossProduct

      public Vector3d crossProduct(Vector3d other)
      Computes the cross-product of the tuple with another.
      Parameters:
      other - the other tuple to use in the dot product operation.
      Returns:
      the computed cross-product.
    • equals

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

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

      public int hashCode()
      Overrides:
      hashCode in class Tuple3d