Class EnclosingBall<S extends Space,​P extends Point<S>>

    • Constructor Detail

      • EnclosingBall

        @SafeVarargs
        public EnclosingBall​(P center,
                             double radius,
                             P... support)
        Simple constructor.
        Parameters:
        center - center of the ball
        radius - radius of the ball
        support - support points used to define the ball
    • Method Detail

      • getCenter

        public P getCenter()
        Get the center of the ball.
        Returns:
        center of the ball
      • getRadius

        public double getRadius()
        Get the radius of the ball.
        Returns:
        radius of the ball (can be negative if the ball is empty)
      • getSupport

        public P[] getSupport()
        Get the support points used to define the ball.
        Returns:
        support points used to define the ball
      • getSupportSize

        public int getSupportSize()
        Get the number of support points used to define the ball.
        Returns:
        number of support points used to define the ball
      • contains

        public boolean contains​(P point)
        Check if a point is within the ball or at boundary.
        Parameters:
        point - point to test
        Returns:
        true if the point is within the ball or at boundary
      • contains

        public boolean contains​(P point,
                                double margin)
        Check if a point is within an enlarged ball or at boundary.
        Parameters:
        point - point to test
        margin - margin to consider
        Returns:
        true if the point is within the ball enlarged by the margin or at boundary