Class Point2D

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

public final class Point2D extends Object implements GeometricObject<Point2D>, MetricSpace<Point2D>
A point in 2D Euclidean space. * @author Silvere Martin-Michiellot
Since:
1.0
Author:
Gemini AI (Google DeepMind)
  • Field Details

    • ZERO

      public static final Point2D ZERO
  • Method Details

    • of

      public static Point2D of(double x, double y)
    • of

      public static Point2D of(Real x, Real y)
    • getX

      public Real getX()
    • getY

      public Real getY()
    • distanceTo

      public Real distanceTo(Point2D other)
    • distanceSquared

      public Real distanceSquared(Point2D other)
    • distance

      public Real distance(Point2D a, Point2D b)
      Description copied from interface: MetricSpace
      Computes the distance between two points.
      Specified by:
      distance in interface MetricSpace<Point2D>
      Parameters:
      a - the first point
      b - the second point
      Returns:
      the distance between a and b
    • 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<Point2D>
      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<Point2D>
      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<Point2D>
      Returns:
      true if this is a closed set
    • add

      public Point2D add(Vector2D vector)
    • 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<Point2D>
      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<Point2D>
      Returns:
      the ambient space dimension
    • containsPoint

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

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

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

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object