Class LineConvexSubset
java.lang.Object
org.apache.commons.geometry.euclidean.twod.LineSubset
org.apache.commons.geometry.euclidean.twod.LineConvexSubset
- All Implemented Interfaces:
Embedding<Vector2D,Vector1D>, HyperplaneConvexSubset<Vector2D>, HyperplaneSubset<Vector2D>, Splittable<Vector2D, HyperplaneSubset<Vector2D>>, RegionEmbedding<Vector2D, Vector1D>, Sized
- Direct Known Subclasses:
LineSpanningSubset, Ray, ReverseRay, Segment
public abstract class LineConvexSubset
extends LineSubset
implements HyperplaneConvexSubset<Vector2D>
Class representing a convex subset of a line in 2D Euclidean space. Instances
need not be finite, in which case the start or end point (or both) will be null.
Line segments and rays are examples of convex line subsets.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the closest point to the argument that is contained in the subset (ie, not classified asoutside), or null if no such point exists.(package private) abstract doubleclosestAbscissa(double abscissa) Get the closest value in the subspace region to the given abscissa.abstract Vector2DGet the end point for the subset.Get the 1D interval for the region.abstract Vector2DGet the start point for the subset.abstract doubleGet the 1D end location of the subset orDouble.POSITIVE_INFINITYif no end location exists.Get the embedded subspace region.abstract doubleGet the 1D start location of the subset orDouble.NEGATIVE_INFINITYif no start location exists.booleanisEmpty()Return true if this instance does not contain any points.abstract LineConvexSubsetreverse()Reverse the orientation of the hyperplane for this instance, returning the result as a new instance.split(Hyperplane<Vector2D> splitter) Split this instance with the given hyperplane.(package private) abstract Split<LineConvexSubset> splitOnIntersection(Line splitter, Vector2D intersection) Split this instance using the given splitter line and intersection point.toConvex()Convert this instance into a list of convex child subsets representing the same region.abstract LineConvexSubsetReturn a new hyperplane subset resulting from the application of the given transform.Methods inherited from class LineSubset
classify, classifyAbscissa, createSplitResult, getBounds, getHyperplane, getLine, getNonIntersectingSplitResult, getPrecision, intersection, intersection, splitterPlusIsPositiveFacing, toSpace, toSubspaceMethods 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
classify, contains, getCentroid, getHyperplane, isFullMethods inherited from interface Sized
getSize, isFinite, isInfinite
-
Constructor Details
-
LineConvexSubset
LineConvexSubset(Line line) Construct a new instance for the given line.- Parameters:
line- line containing this line subset
-
-
Method Details
-
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>- Specified by:
toConvexin classLineSubset- Returns:
- a list of hyperplane convex subsets representing the same subspace region as this instance
-
isEmpty
public boolean isEmpty()Return true if this instance does not contain any points.This method always returns
false.- Specified by:
isEmptyin interfaceHyperplaneSubset<Vector2D>- Returns:
- true if this instance does not contain any points
-
getStartPoint
Get the start point for the subset.- Returns:
- the start point for the subset, or null if no start point exists
-
getSubspaceStart
public abstract double getSubspaceStart()Get the 1D start location of the subset orDouble.NEGATIVE_INFINITYif no start location exists.- Returns:
- the 1D start location of the subset or
Double.NEGATIVE_INFINITYif no start location exists.
-
getEndPoint
Get the end point for the subset.- Returns:
- the end point for the subset, or null if no end point exists.
-
getSubspaceEnd
public abstract double getSubspaceEnd()Get the 1D end location of the subset orDouble.POSITIVE_INFINITYif no end location exists.- Returns:
- the 1D end location of the subset or
Double.POSITIVE_INFINITYif no end location exists
-
getSubspaceRegion
Get the embedded subspace region.- Specified by:
getSubspaceRegionin interfaceRegionEmbedding<Vector2D,Vector1D> - Specified by:
getSubspaceRegionin classLineSubset- Returns:
- the embedded subspace region
-
getInterval
Get the 1D interval for the region. This method is an alias forgetSubspaceRegion().- Returns:
- the 1D interval for the region.
-
split
Split this instance with the given hyperplane.- Specified by:
splitin interfaceHyperplaneConvexSubset<Vector2D>- Specified by:
splitin interfaceSplittable<Vector2D, HyperplaneSubset<Vector2D>>- Parameters:
splitter- the hyperplane to split this object with.- Returns:
- result of the split operation
-
closest
Return the closest point to the argument that is contained in the subset (ie, not classified asoutside), or null if no such point exists.- Specified by:
closestin interfaceHyperplaneSubset<Vector2D>- Parameters:
pt- the reference point- Returns:
- the closest point to the reference point that is contained in the subset, or null if no such point exists
-
transform
Return a new hyperplane subset resulting from the application of the given transform. The current instance is not modified.- Specified by:
transformin interfaceHyperplaneConvexSubset<Vector2D>- Specified by:
transformin interfaceHyperplaneSubset<Vector2D>- Parameters:
transform- the transform instance to apply- Returns:
- new transformed hyperplane subset
-
reverse
Reverse the orientation of the hyperplane for this instance, returning the result as a new instance. The returned subset contains the same points but has a reversed orientation.- Specified by:
reversein interfaceHyperplaneConvexSubset<Vector2D>- Returns:
- a hyperplane convex subset representing the same region but with the opposite orientation.
-
closestAbscissa
abstract double closestAbscissa(double abscissa) Get the closest value in the subspace region to the given abscissa.- Parameters:
abscissa- input abscissa- Returns:
- the closest value in the subspace region to the given abscissa
-
splitOnIntersection
Split this instance using the given splitter line and intersection point.- Parameters:
splitter- splitter lineintersection- intersection point between the splitter line and the line for this instance- Returns:
- the result of splitting this instance with the given splitter line and intersection point
-