Class PointND

java.lang.Object
org.episteme.core.mathematics.geometry.PointND
All Implemented Interfaces:
GeometricObject<PointND>, Set<PointND>, MetricSpace<PointND>, TopologicalSpace<PointND>

public class PointND extends Object implements GeometricObject<PointND>, MetricSpace<PointND>
Represents an N-dimensional point.

A point is a position in N-dimensional Euclidean space, represented by N coordinates. Points are distinct from vectors - they represent positions, not directions.

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

    • PointND

      public PointND(List<Real> coords)
      Creates a point from a list of coordinates.
      Parameters:
      coords - the coordinates
    • PointND

      public PointND(Vector<Real> coords)
      Creates a point from a vector.
      Parameters:
      coords - the coordinate vector
  • Method Details

    • of

      public static PointND of(Real... coords)
      Creates a point from varargs coordinates.
      Parameters:
      coords - the coordinates
    • of

      public static PointND of(double... coords)
      Creates a point from double coordinates.
      Parameters:
      coords - the coordinates
    • dimension

      public int dimension()
      Description copied from interface: GeometricObject
      Returns the intrinsic dimension of this geometric object.

      Examples:

      • Point: 0
      • Line/Segment: 1
      • Plane/Surface: 2
      • Volume: 3

      Specified by:
      dimension in interface GeometricObject<PointND>
      Returns:
      the dimension
    • ambientDimension

      public int ambientDimension()
      Description copied from interface: GeometricObject
      Returns the dimension of the ambient space containing this object.

      For example, a 2D plane in 3D space has dimension=2 but ambientDimension=3.

      Specified by:
      ambientDimension in interface GeometricObject<PointND>
      Returns:
      the ambient space dimension
    • get

      public Real get(int index)
      Gets the coordinate at the specified index.
      Parameters:
      index - the index (0-based)
      Returns:
      the coordinate value
    • toVector

      public Vector<Real> toVector()
      Returns the coordinates as a vector.
      Returns:
      the coordinate vector
    • containsPoint

      public boolean containsPoint(PointND point)
      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<PointND>
      Parameters:
      point - the point to check
      Returns:
      true if the point is in this space
    • contains

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

      public Real distance(PointND a, PointND b)
      Computes the Euclidean distance to another point.
      Specified by:
      distance in interface MetricSpace<PointND>
      Parameters:
      a - the first point
      b - the second point
      other - the other point
      Returns:
      the distance
    • 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<PointND>
      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<PointND>
      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<PointND>
      Returns:
      true if this is a closed set
    • distanceTo

      public Real distanceTo(PointND other)
    • translate

      public PointND translate(Vector<Real> vector)
      Translates this point by a vector.
      Parameters:
      vector - the translation vector
      Returns:
      the translated point
    • midpoint

      public PointND midpoint(PointND other)
      Computes the midpoint between this point and another.
      Parameters:
      other - the other point
      Returns:
      the midpoint
    • interpolate

      public PointND interpolate(PointND other, Real t)
      Linear interpolation between this point and another.

      Returns: this + t*(other - this) - t=0 gives this - t=1 gives other - t=0.5 gives midpoint

      Parameters:
      other - the other point
      t - the interpolation parameter
      Returns:
      the interpolated point
    • description

      public String description()
      Description copied from interface: GeometricObject
      Returns a human-readable description of this geometric object.
      Specified by:
      description in interface GeometricObject<PointND>
      Specified by:
      description in interface Set<PointND>
      Returns:
      description string
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object