Class Hyperplane

java.lang.Object
org.episteme.core.mathematics.geometry.Hyperplane
All Implemented Interfaces:
GeometricObject<PointND>

public class Hyperplane extends Object implements GeometricObject<PointND>
Represents an N-dimensional hyperplane.

A hyperplane is an (N-1)-dimensional affine subspace of an N-dimensional space. It divides the space into two half-spaces.

Defined by: {x | ⟨x - point, normal⟩ = 0} where point is any point on the hyperplane and normal is the normal vector.

Examples: - In 2D: a hyperplane is a line - In 3D: a hyperplane is a plane - In 4D: a hyperplane is a 3D space

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

    • Hyperplane

      public Hyperplane(PointND point, Vector<Real> normal)
      Creates a hyperplane from a point and normal vector.
      Parameters:
      point - a point on the hyperplane
      normal - the normal vector (will be normalized)
  • Method Details

    • through

      public static Hyperplane through(PointND... points)
      Creates a hyperplane from N points (for N-dimensional space).

      The points must be affinely independent.

      Parameters:
      points - the points defining the hyperplane
    • 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
    • getPoint

      public PointND getPoint()
    • getNormal

      public Vector<Real> getNormal()
    • containsPoint

      public boolean containsPoint(PointND p)
    • signedDistance

      public Real signedDistance(PointND p)
      Computes the signed distance from a point to this hyperplane.

      Positive if on the side of the normal, negative otherwise.

      Parameters:
      p - the point
      Returns:
      the signed distance
    • distanceTo

      public Real distanceTo(PointND p)
      Computes the unsigned distance from a point to this hyperplane.
      Parameters:
      p - the point
      Returns:
      the distance
    • project

      public PointND project(PointND p)
      Projects a point onto this hyperplane.
      Parameters:
      p - the point to project
      Returns:
      the projected point on the hyperplane
    • side

      public int side(PointND p)
      Checks which side of the hyperplane a point is on.
      Parameters:
      p - the point
      Returns:
      positive if on normal side, negative if opposite, 0 if on plane
    • isParallelTo

      public boolean isParallelTo(Hyperplane other)
      Checks if this hyperplane is parallel to another.
      Parameters:
      other - the other hyperplane
      Returns:
      true if parallel
    • intersection

      public PointND intersection(LineND line)
      Finds the intersection with a line.

      Returns null if line is parallel to the hyperplane.

      Parameters:
      line - the line
      Returns:
      the intersection point, or null if parallel
    • 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>
      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