Class LineSubset

    • Field Detail

      • line

        private final Line line
        The line containing this instance.
    • Constructor Detail

      • LineSubset

        LineSubset​(Line line)
        Construct a new instance based on the given line.
        Parameters:
        line - line forming the base of the instance
    • Method Detail

      • getLine

        public Line getLine()
        Get the line containing this subset. This method is an alias for getHyperplane().
        Returns:
        the line containing this subset
        See Also:
        getHyperplane()
      • getHyperplane

        public Line getHyperplane()
        Get the hyperplane containing this instance.
        Specified by:
        getHyperplane in interface HyperplaneSubset<Vector2D>
        Returns:
        the hyperplane containing this instance
      • getBounds

        public abstract Bounds2D getBounds()
        Get a Bounds2D object 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
      • toConvex

        public abstract java.util.List<LineConvexSubset> 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:
        toConvex in interface HyperplaneSubset<Vector2D>
        Returns:
        a list of hyperplane convex subsets representing the same subspace region as this instance
      • classify

        public RegionLocation classify​(Vector2D pt)
        Classify a point with respect to the subset region. The point is classified as follows:
        • INSIDE - The point lies on the hyperplane and inside of the subset region.
        • BOUNDARY - The point lies on the hyperplane and is on the boundary of the subset region.
        • OUTSIDE - The point does not lie on the hyperplane or it does lie on the hyperplane but is outside of the subset region.
        Specified by:
        classify in interface HyperplaneSubset<Vector2D>
        Parameters:
        pt - the point to classify
        Returns:
        classification of the point with respect to the hyperplane and subspace region
      • intersection

        public Vector2D intersection​(Line inputLine)
        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:
        Line.intersection(Line)
      • intersection

        public Vector2D intersection​(LineSubset subset)
        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:
        Line.intersection(Line)
      • getPrecision

        public org.apache.commons.numbers.core.Precision.DoubleEquivalence getPrecision()
        Return the object used to perform floating point comparisons, which is the same object used by the underlying Line).
        Returns:
        precision object used to perform floating point comparisons.
      • classifyAbscissa

        abstract RegionLocation classifyAbscissa​(double abscissa)
        Classify the given line abscissa value with respect to the subspace region.
        Parameters:
        abscissa - the abscissa value to classify
        Returns:
        the region location of the line abscissa value
      • getNonIntersectingSplitResult

        <T extends LineSubsetSplit<T> getNonIntersectingSplitResult​(Line splitter,
                                                                      T subset)
        Get a split result for cases where no intersection exists between the splitting line and the line underlying the given line subset. This occurs when the two lines are parallel or coincident.
        Type Parameters:
        T - Line subset type
        Parameters:
        splitter - splitting line
        subset - line subset instance being split
        Returns:
        return result of the non-intersecting split operation
      • splitterPlusIsPositiveFacing

        boolean splitterPlusIsPositiveFacing​(Line splitterLine)
        Return true if the plus side of the given splitter line is facing in the positive direction of this line.
        Parameters:
        splitterLine - line splitting this instance
        Returns:
        true if the plus side of the given line is facing in the positive direction of this line
      • createSplitResult

        <T extends LineSubsetSplit<T> createSplitResult​(Line splitter,
                                                          T low,
                                                          T high)
        Create a split result for the given splitter line, given the low and high split portion of this instance. The arguments are assigned to the split result's minus and plus properties based on the relative orientation of the splitter line.
        Type Parameters:
        T - Line subset type
        Parameters:
        splitter - splitter line
        low - portion of the split result closest to negative infinity on this line
        high - portion of th split result closest to positive infinity on this line
        Returns:
        a split result for the given splitter line.