Class VectorND

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 VectorND extends DenseVector<Real> implements MetricSpace<Vector<Real>>
Represents an N-dimensional geometric vector.

A geometric vector represents a direction and magnitude in N-dimensional space. Unlike points (which represent positions), vectors represent displacements, velocities, forces, etc.

Key distinction from algebraic vectors: - VectorND is specifically for geometric operations (cross product, angles, etc.) - Vector is for general linear algebra - VectorND wraps Vector but adds geometric semantics

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • VectorND

      public VectorND(List<Real> components)
    • VectorND

      public VectorND(Vector<Real> vector)
  • Method Details

    • of

      public static VectorND of(Real... components)
    • of

      public static VectorND of(double... components)
    • zero

      public static VectorND zero(int dimension)
    • unitVector

      public static VectorND unitVector(int dimension, int direction)
    • toVector

      public Vector<Real> toVector()
    • add

      public VectorND add(VectorND other)
    • subtract

      public VectorND subtract(VectorND other)
    • multiply

      public VectorND 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 VectorND divide(Real scalar)
    • negate

      public VectorND 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
    • dot

      public Real dot(VectorND other)
    • 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
    • contains

      public boolean contains(Vector<Real> element)
      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:
      element - the element to test for membership
      Returns:
      true if this set contains the element, false otherwise
      See Also:
    • 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
    • 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
    • cross

      public VectorND cross(VectorND other)
    • normSquared

      public Real normSquared()
    • normalize

      public VectorND 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()
    • isUnit

      public boolean isUnit()
    • isZero

      public boolean isZero()
    • angleTo

      public Real angleTo(VectorND other)
    • toString

      public String toString()
      Overrides:
      toString in class DenseVector<Real>