Class LineSubset
java.lang.Object
org.apache.commons.geometry.euclidean.twod.LineSubset
- All Implemented Interfaces:
Embedding<Vector2D,Vector1D>, HyperplaneSubset<Vector2D>, Splittable<Vector2D, HyperplaneSubset<Vector2D>>, RegionEmbedding<Vector2D, Vector1D>, Sized
- Direct Known Subclasses:
EmbeddedTreeLineSubset, LineConvexSubset
public abstract class LineSubset
extends Object
implements HyperplaneSubset<Vector2D>, RegionEmbedding<Vector2D,Vector1D>
Class representing a subset of points on a line in 2D Euclidean space. For example, line segments
and rays are line subsets. Line subsets may be finite or infinite.
-
Method Summary
Modifier and TypeMethodDescriptionClassify a point with respect to the subset region.abstract Bounds2DGet aBounds2Dobject defining an axis-aligned bounding box containing all vertices for this subset.Get the hyperplane containing this instance.getLine()Get the line containing this subset.org.apache.commons.numbers.core.Precision.DoubleEquivalenceReturn the object used to perform floating point comparisons, which is the same object used by the underlyingLine).abstract HyperplaneBoundedRegion<Vector1D> Get the embedded subspace region.intersection(Line inputLine) Get the unique intersection of this subset with the given line.intersection(LineSubset subset) Get the unique intersection of this instance with the given line subset.abstract List<LineConvexSubset> toConvex()Convert this instance into a list of convex child subsets representing the same region.Transform a subspace point into a space point.toSubspace(Vector2D pt) Transform a space point into a subspace point.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Embedding
toSpace, toSubspaceMethods inherited from interface HyperplaneSubset
closest, contains, getCentroid, isEmpty, isFull, transformMethods inherited from interface Sized
getSize, isFinite, isInfiniteMethods inherited from interface Splittable
split
-
Method Details
-
getLine
Get the line containing this subset. This method is an alias forgetHyperplane().- Returns:
- the line containing this subset
- See Also:
-
getHyperplane
Get the hyperplane containing this instance.- Specified by:
getHyperplanein interfaceHyperplaneSubset<Vector2D>- Returns:
- the hyperplane containing this instance
-
toSubspace
Transform a space point into a subspace point.- Specified by:
toSubspacein interfaceEmbedding<Vector2D,Vector1D> - Parameters:
pt- n-dimension point of the space- Returns:
- lower-dimension point of the subspace corresponding to the specified space point
- See Also:
-
getBounds
Get aBounds2Dobject defining an axis-aligned bounding box containing all vertices for this subset. Null is returned if the subset is infinite or does not contain any vertices.- Returns:
- the bounding box for this instance or null if no valid bounds could be determined
-
getSubspaceRegion
Get the embedded subspace region.- Specified by:
getSubspaceRegionin interfaceRegionEmbedding<Vector2D,Vector1D> - Returns:
- the embedded subspace region
-
toSpace
-
toConvex
Convert this instance into a list of convex child subsets representing the same region. Implementations are not required to return an optimal convex subdivision of the current instance. They are free to return whatever subdivision is readily available.- Specified by:
toConvexin interfaceHyperplaneSubset<Vector2D>- Returns:
- a list of hyperplane convex subsets representing the same subspace region as this instance
-
classify
Classify a point with respect to the subset region. The point is classified as follows:- Specified by:
classifyin interfaceHyperplaneSubset<Vector2D>- Parameters:
pt- the point to classify- Returns:
- classification of the point with respect to the hyperplane and subspace region
-
intersection
Get the unique intersection of this subset with the given line. Null is returned if no unique intersection point exists (ie, the lines are parallel or coincident) or the line does not intersect this instance.- Parameters:
inputLine- line to intersect with this line subset- Returns:
- the unique intersection point between the line and this line subset or null if no such point exists.
- See Also:
-
intersection
Get the unique intersection of this instance with the given line subset. Null is returned if the lines containing the line subsets do not have a unique intersection point (ie, they are parallel or coincident) or the intersection point is unique but is not contained in both line subsets.- Parameters:
subset- line subset to intersect with- Returns:
- the unique intersection point between this line subset and the argument or null if no such point exists.
- See Also:
-
getPrecision
Return the object used to perform floating point comparisons, which is the same object used by the underlyingLine).- Returns:
- precision object used to perform floating point comparisons.
-