Class Vector4D

All Implemented Interfaces:
Vector<Real>, AbelianGroup<Vector<Real>>, AbelianMonoid<Vector<Real>>, Group<Vector<Real>>, Magma<Vector<Real>>, Monoid<Vector<Real>>, Set<Vector<Real>>, Module<Vector<Real>, Real>, MetricSpace<Vector<Real>>, TopologicalSpace<Vector<Real>>

public class Vector4D extends DenseVector<Real> implements MetricSpace<Vector<Real>>
Represents a 4D vector, typically used for spacetime coordinates (ct, x, y, z).
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Field Details

    • ZERO

      public static final Vector4D ZERO
  • Constructor Details

    • Vector4D

      public Vector4D(double t, double x, double y, double z)
      Creates a new Vector4D from double coordinates.
      Parameters:
      t - the t (time) coordinate
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
    • Vector4D

      public Vector4D(Real t, Real x, Real y, Real z)
      Creates a new Vector4D from Real coordinates.
      Parameters:
      t - the t (time) coordinate
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
  • Method Details

    • ct

      public Real ct()
    • x

      public Real x()
    • y

      public Real y()
    • z

      public Real z()
    • getCt

      public double getCt()
    • getX

      public double getX()
    • getY

      public double getY()
    • getZ

      public double getZ()
    • normalize

      public Vector4D normalize()
      Description copied from interface: Vector
      Returns the normalized vector (unit vector).
      Specified by:
      normalize in interface Vector<Real>
      Overrides:
      normalize in class GenericVector<Real>
      Returns:
      this / norm()
    • normValue

      public Real normValue()
    • multiply

      public Vector4D multiply(Real scalar)
      Description copied from interface: Vector
      Returns the scalar product of this vector.
      Specified by:
      multiply in interface Vector<Real>
      Overrides:
      multiply in class GenericVector<Real>
      Parameters:
      scalar - the scalar multiplier
      Returns:
      this * scalar
    • divide

      public Vector4D divide(Real scalar)
    • negate

      public Vector4D negate()
      Description copied from interface: Vector
      Returns the negation of this vector (-this).
      Specified by:
      negate in interface Vector<Real>
      Overrides:
      negate in class GenericVector<Real>
      Returns:
      -this
    • distance

      public Real distance(Vector<Real> a, Vector<Real> b)
      Description copied from interface: MetricSpace
      Computes the distance between two points.
      Specified by:
      distance in interface MetricSpace<Vector<Real>>
      Parameters:
      a - the first point
      b - the second point
      Returns:
      the distance between a and b
    • containsPoint

      public boolean containsPoint(Vector<Real> p)
      Description copied from interface: TopologicalSpace
      Checks if this space contains the given point.

      Named containsPoint to avoid erasure conflict with Set.contains.

      Specified by:
      containsPoint in interface TopologicalSpace<Vector<Real>>
      Parameters:
      p - the point to check
      Returns:
      true if the point is in this space
    • contains

      public boolean contains(Vector<Real> p)
      Description copied from interface: Set
      Tests whether this set contains the specified element.

      This is the fundamental operation of a set - membership testing.

      Specified by:
      contains in interface Set<Vector<Real>>
      Overrides:
      contains in class GenericVector<Real>
      Parameters:
      p - the element to test for membership
      Returns:
      true if this set contains the element, false otherwise
      See Also:
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Set
      Returns true if this set contains no elements.

      The empty set (∅) is a fundamental concept in set theory. It is the unique set containing no elements.

      Specified by:
      isEmpty in interface Set<Vector<Real>>
      Overrides:
      isEmpty in class GenericVector<Real>
      Returns:
      true if this set is empty
    • isOpen

      public boolean isOpen()
      Description copied from interface: TopologicalSpace
      Checks if this set is open in the topology.
      Specified by:
      isOpen in interface TopologicalSpace<Vector<Real>>
      Returns:
      true if this is an open set
    • isClosed

      public boolean isClosed()
      Description copied from interface: TopologicalSpace
      Checks if this set is closed in the topology.
      Specified by:
      isClosed in interface TopologicalSpace<Vector<Real>>
      Returns:
      true if this is a closed set
    • subtract

      public Vector4D subtract(Vector4D other)
    • add

      public Vector4D add(Vector4D other)