Interface HyperplaneSubset<P extends Point<P>>
-
- Type Parameters:
P
- Point implementation type
- All Superinterfaces:
Sized
,Splittable<P,HyperplaneSubset<P>>
- All Known Subinterfaces:
ConvexPolygon3D
,HyperplaneConvexSubset<P>
,PlaneConvexSubset
,PlaneSubset
,Triangle3D
- All Known Implementing Classes:
AbstractConvexPolygon3D
,AbstractEmbeddedRegionPlaneSubset
,AbstractPlaneSubset
,CutAngle.CutAngleConvexSubset
,EmbeddedAreaPlaneConvexSubset
,EmbeddedTreeGreatCircleSubset
,EmbeddedTreeLineSubset
,EmbeddedTreePlaneSubset
,GreatArc
,GreatCircleSubset
,LineConvexSubset
,LineSpanningSubset
,LineSubset
,OrientedPoint.OrientedPointConvexSubset
,Ray
,ReverseRay
,Segment
,SimpleTriangle3D
,VertexListConvexPolygon3D
public interface HyperplaneSubset<P extends Point<P>> extends Splittable<P,HyperplaneSubset<P>>, Sized
Interface representing a subset of the points lying in a hyperplane. Examples include rays and line segments in Euclidean 2D space and triangular facets in Euclidean 3D space. Hyperplane subsets can have finite or infinite size and can represent contiguous regions of the hyperplane (as in the examples above); multiple, disjoint regions; or theentire hyperplane
.This interface is very similar to the
Region
interface but has slightly different semantics. WhereasRegion
instances represent sets of points that can expand through all of the dimensions of a space,HyperplaneSubset
instances are constrained to their containing hyperplane and are more accurately defined asRegion
s of then-1
dimension subspace defined by the hyperplane. This makes the methods of this interface have slightly different meanings as compared to theirRegion
counterparts. For example, consider a triangular facet in Euclidean 3D space. TheSized.getSize()
method of this hyperplane subset does not return the volume of the instance (which would be0
) as a regular 3D region would, but rather returns the area of the 2D polygon defined by the facet. Similarly, theclassify(Point)
method returnsRegionLocation.INSIDE
for points that lie inside of the 2D polygon defined by the facet, instead of theRegionLocation.BOUNDARY
value that would be expected if the facet was considered as a true 3D region with zero thickness.- See Also:
Hyperplane
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description RegionLocation
classify(P pt)
Classify a point with respect to the subset region.P
closest(P pt)
Return the closest point to the argument that is contained in the subset (ie, not classified asoutside
), or null if no such point exists.default boolean
contains(P pt)
Return true if the hyperplane subset contains the given point, meaning that the point lies on the hyperplane and is not on the outside of the subset region.P
getCentroid()
Get the centroid, or geometric center, of the hyperplane subset or null if no centroid exists or one exists but is not unique.Hyperplane<P>
getHyperplane()
Get the hyperplane containing this instance.boolean
isEmpty()
Return true if this instance does not contain any points.boolean
isFull()
Return true if this instance contains all points in the hyperplane.java.util.List<? extends HyperplaneConvexSubset<P>>
toConvex()
Convert this instance into a list of convex child subsets representing the same region.HyperplaneSubset<P>
transform(Transform<P> transform)
Return a new hyperplane subset resulting from the application of the given transform.-
Methods inherited from interface org.apache.commons.geometry.core.Sized
getSize, isFinite, isInfinite
-
Methods inherited from interface org.apache.commons.geometry.core.partitioning.Splittable
split
-
-
-
-
Method Detail
-
getHyperplane
Hyperplane<P> getHyperplane()
Get the hyperplane containing this instance.- Returns:
- the hyperplane containing this instance
-
isFull
boolean isFull()
Return true if this instance contains all points in the hyperplane.- Returns:
- true if this instance contains all points in the hyperplane
-
isEmpty
boolean isEmpty()
Return true if this instance does not contain any points.- Returns:
- true if this instance does not contain any points
-
getCentroid
P getCentroid()
Get the centroid, or geometric center, of the hyperplane subset or null if no centroid exists or one exists but is not unique. A centroid will not exist for empty or infinite subsets.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 hyperplane subset or null if no unique centroid exists
- See Also:
- Centroid
-
classify
RegionLocation classify(P pt)
Classify a point with respect to the subset region. The point is classified as follows:- Parameters:
pt
- the point to classify- Returns:
- classification of the point with respect to the hyperplane and subspace region
-
contains
default boolean contains(P pt)
Return true if the hyperplane subset contains the given point, meaning that the point lies on the hyperplane and is not on the outside of the subset region.- Parameters:
pt
- the point to check- Returns:
- true if the point is contained in the hyperplane subset
-
closest
P closest(P pt)
Return the closest point to the argument that is contained in the subset (ie, not classified asoutside
), or null if no such point exists.- 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
HyperplaneSubset<P> transform(Transform<P> transform)
Return a new hyperplane subset resulting from the application of the given transform. The current instance is not modified.- Parameters:
transform
- the transform instance to apply- Returns:
- new transformed hyperplane subset
-
toConvex
java.util.List<? extends HyperplaneConvexSubset<P>> 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.- Returns:
- a list of hyperplane convex subsets representing the same subspace region as this instance
-
-