Class LineConvexSubset

    • Constructor Detail

      • LineConvexSubset

        LineConvexSubset​(Line line)
        Construct a new instance for the given line.
        Parameters:
        line - line containing this line subset
    • Method Detail

      • toConvex

        public 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>
        Specified by:
        toConvex in class LineSubset
        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:
        isEmpty in interface HyperplaneSubset<Vector2D>
        Returns:
        true if this instance does not contain any points
      • getStartPoint

        public abstract Vector2D 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 or Double.NEGATIVE_INFINITY if no start location exists.
        Returns:
        the 1D start location of the subset or Double.NEGATIVE_INFINITY if no start location exists.
      • getEndPoint

        public abstract Vector2D 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 or Double.POSITIVE_INFINITY if no end location exists.
        Returns:
        the 1D end location of the subset or Double.POSITIVE_INFINITY if no end location exists
      • getInterval

        public Interval getInterval()
        Get the 1D interval for the region. This method is an alias for getSubspaceRegion().
        Returns:
        the 1D interval for the region.
      • closest

        public Vector2D closest​(Vector2D pt)
        Return the closest point to the argument that is contained in the subset (ie, not classified as outside), or null if no such point exists.
        Specified by:
        closest in interface HyperplaneSubset<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

        public abstract LineConvexSubset transform​(Transform<Vector2D> transform)
        Return a new hyperplane subset resulting from the application of the given transform. The current instance is not modified.

        Hyperplane convex subsets subjected to affine transformations remain convex.

        Specified by:
        transform in interface HyperplaneConvexSubset<Vector2D>
        Specified by:
        transform in interface HyperplaneSubset<Vector2D>
        Parameters:
        transform - the transform instance to apply
        Returns:
        new transformed hyperplane subset
      • reverse

        public abstract LineConvexSubset 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:
        reverse in interface HyperplaneConvexSubset<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

        abstract Split<LineConvexSubset> splitOnIntersection​(Line splitter,
                                                             Vector2D intersection)
        Split this instance using the given splitter line and intersection point.
        Parameters:
        splitter - splitter line
        intersection - 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