Interface Region<P extends Point<P>>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      RegionLocation classify​(P pt)
      Classify the given point with respect to the region.
      default boolean contains​(P pt)
      Return true if the given point is on the inside or boundary of the region.
      double getBoundarySize()
      Get the size of the boundary of the region.
      P getCentroid()
      Get the centroid, or geometric center, of the region or null if no centroid exists or one exists but is not unique.
      boolean isEmpty()
      Return true if the region is completely empty, ie all points in the space are classified as outside.
      boolean isFull()
      Return true if the region spans the entire space.
      P project​(P pt)
      Project a point onto the boundary of the region.
    • Method Detail

      • isFull

        boolean isFull()
        Return true if the region spans the entire space. In other words, a region is full if no points in the space are classified as outside.
        Returns:
        true if the region spans the entire space
      • isEmpty

        boolean isEmpty()
        Return true if the region is completely empty, ie all points in the space are classified as outside.
        Returns:
        true if the region is empty
      • getBoundarySize

        double getBoundarySize()
        Get the size of the boundary of the region. The size is a value in the d-1 dimension space. For example, in Euclidean space, this will be a length in 2D and an area in 3D.
        Returns:
        the size of the boundary of the region
      • getCentroid

        P getCentroid()
        Get the centroid, or geometric center, of the region or null if no centroid exists or one exists but is not unique. A centroid will not exist for empty or infinite regions.

        The centroid of a geometric object is defined as the mean position of all points in the object, including interior points, vertices, and other points lying on the boundary. If a physical object has a uniform density, then its center of mass is the same as its geometric centroid.

        Returns:
        the centroid of the region or null if no unique centroid exists
        See Also:
        Centroid
      • classify

        RegionLocation classify​(P pt)
        Classify the given point with respect to the region.
        Parameters:
        pt - the point to classify
        Returns:
        the location of the point with respect to the region
      • contains

        default boolean contains​(P pt)
        Return true if the given point is on the inside or boundary of the region.
        Parameters:
        pt - the point to test
        Returns:
        true if the point is on the inside or boundary of the region
      • project

        P project​(P pt)
        Project a point onto the boundary of the region. Null is returned if the region contains no boundaries (ie, is either full or empty).
        Parameters:
        pt - pt to project
        Returns:
        projection of the point on the boundary of the region or null if the region does not contain any boundaries