Class SegmentND
java.lang.Object
org.episteme.core.mathematics.geometry.SegmentND
- All Implemented Interfaces:
GeometricObject<PointND>
Represents an N-dimensional line segment.
A segment is a finite portion of a line, defined by two endpoints. Unlike a line which extends infinitely, a segment has a definite length.
Parametric form: S(t) = start + t*(end - start), where t ∈ [0,1]
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the dimension of the ambient space containing this object.Evaluates the segment at parameter t.Finds the closest point on this segment to a given point.booleanReturns a human-readable description of this geometric object.intReturns the intrinsic dimension of this geometric object.Computes the distance from a point to this segment.booleangetEnd()getStart()inthashCode()booleanintersects(SegmentND other) Checks if this segment intersects another segment.length()Returns the length of this segment.midpoint()Returns the midpoint of this segment.toLine()Converts this segment to a line.toString()
-
Constructor Details
-
SegmentND
-
-
Method Details
-
dimension
public int dimension()Description copied from interface:GeometricObjectReturns the intrinsic dimension of this geometric object.Examples:
- Point: 0
- Line/Segment: 1
- Plane/Surface: 2
- Volume: 3
- Specified by:
dimensionin interfaceGeometricObject<PointND>- Returns:
- the dimension
-
ambientDimension
public int ambientDimension()Description copied from interface:GeometricObjectReturns 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:
ambientDimensionin interfaceGeometricObject<PointND>- Returns:
- the ambient space dimension
-
getStart
-
getEnd
-
midpoint
-
length
-
at
-
toLine
-
containsPoint
-
closestPoint
-
distanceTo
-
intersects
Checks if this segment intersects another segment.- Parameters:
other- the other segment- Returns:
- true if segments intersect
-
description
Description copied from interface:GeometricObjectReturns a human-readable description of this geometric object.- Specified by:
descriptionin interfaceGeometricObject<PointND>- Returns:
- description string
-
toString
-
equals
-
hashCode
-