Class GreatCircleSubset
- java.lang.Object
-
- org.apache.commons.geometry.spherical.twod.GreatCircleSubset
-
- All Implemented Interfaces:
Embedding<Point2S,Point1S>
,HyperplaneSubset<Point2S>
,Splittable<Point2S,HyperplaneSubset<Point2S>>
,RegionEmbedding<Point2S,Point1S>
,Sized
- Direct Known Subclasses:
EmbeddedTreeGreatCircleSubset
,GreatArc
public abstract class GreatCircleSubset extends java.lang.Object implements HyperplaneSubset<Point2S>, RegionEmbedding<Point2S,Point1S>
Class representing a subset of the points in a great circle.- See Also:
GreatCircles
-
-
Field Summary
Fields Modifier and Type Field Description private GreatCircle
circle
The great circle defining this instance.
-
Constructor Summary
Constructors Constructor Description GreatCircleSubset(GreatCircle circle)
Simple constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description RegionLocation
classify(Point2S pt)
Classify a point with respect to the subset region.Point2S
closest(Point2S 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.Point2S
getCentroid()
Get the centroid, or geometric center, of the hyperplane subset or null if no centroid exists or one exists but is not unique.GreatCircle
getCircle()
Get the great circle defining this instance.GreatCircle
getHyperplane()
Get the hyperplane containing this instance.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 underlyingGreatCircle
.double
getSize()
Get the size of the instance.abstract HyperplaneBoundedRegion<Point1S>
getSubspaceRegion()
Get the embedded subspace region.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.abstract java.util.List<GreatArc>
toConvex()
Convert this instance into a list of convex child subsets representing the same region.Point2S
toSpace(Point1S pt)
Transform a subspace point into a space point.Point1S
toSubspace(Point2S pt)
Transform a space point into a subspace point.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.geometry.core.Embedding
toSpace, toSubspace
-
Methods inherited from interface org.apache.commons.geometry.core.partitioning.HyperplaneSubset
contains, transform
-
Methods inherited from interface org.apache.commons.geometry.core.Sized
isFinite, isInfinite
-
Methods inherited from interface org.apache.commons.geometry.core.partitioning.Splittable
split
-
-
-
-
Field Detail
-
circle
private final GreatCircle circle
The great circle defining this instance.
-
-
Constructor Detail
-
GreatCircleSubset
GreatCircleSubset(GreatCircle circle)
Simple constructor.- Parameters:
circle
- great circle defining this instance
-
-
Method Detail
-
getCircle
public GreatCircle getCircle()
Get the great circle defining this instance.- Returns:
- the great circle defining this instance
- See Also:
getHyperplane()
-
getHyperplane
public GreatCircle getHyperplane()
Get the hyperplane containing this instance.- Specified by:
getHyperplane
in interfaceHyperplaneSubset<Point2S>
- Returns:
- the hyperplane containing this instance
-
toSubspace
public Point1S toSubspace(Point2S pt)
Transform a space point into a subspace point.- Specified by:
toSubspace
in interfaceEmbedding<Point2S,Point1S>
- Parameters:
pt
- n-dimension point of the space- Returns:
- lower-dimension point of the subspace corresponding to the specified space point
- See Also:
Embedding.toSpace(S)
-
toSpace
public Point2S toSpace(Point1S pt)
Transform a subspace point into a space point.- Specified by:
toSpace
in interfaceEmbedding<Point2S,Point1S>
- Parameters:
pt
- lower-dimension point of the subspace- Returns:
- n-dimension point of the space corresponding to the specified subspace point
- See Also:
Embedding.toSubspace(Point)
-
isFull
public boolean isFull()
Return true if this instance contains all points in the hyperplane.- Specified by:
isFull
in interfaceHyperplaneSubset<Point2S>
- Returns:
- true if this instance contains all points in the hyperplane
-
isEmpty
public boolean isEmpty()
Return true if this instance does not contain any points.- Specified by:
isEmpty
in interfaceHyperplaneSubset<Point2S>
- Returns:
- true if this instance does not contain any points
-
getSize
public double getSize()
Get the size of the instance.
-
getCentroid
public Point2S 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.
- Specified by:
getCentroid
in interfaceHyperplaneSubset<Point2S>
- Returns:
- the centroid of the hyperplane subset or null if no unique centroid exists
- See Also:
- Centroid
-
classify
public RegionLocation classify(Point2S pt)
Classify a point with respect to the subset region. The point is classified as follows:- Specified by:
classify
in interfaceHyperplaneSubset<Point2S>
- Parameters:
pt
- the point to classify- Returns:
- classification of the point with respect to the hyperplane and subspace region
-
closest
public Point2S closest(Point2S 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.- Specified by:
closest
in interfaceHyperplaneSubset<Point2S>
- 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
-
toConvex
public abstract java.util.List<GreatArc> 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 interfaceHyperplaneSubset<Point2S>
- Returns:
- a list of hyperplane convex subsets representing the same subspace region as this instance
-
getSubspaceRegion
public abstract HyperplaneBoundedRegion<Point1S> getSubspaceRegion()
Get the embedded subspace region.- Specified by:
getSubspaceRegion
in interfaceRegionEmbedding<Point2S,Point1S>
- Returns:
- the embedded subspace region
-
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 underlyingGreatCircle
.- Returns:
- precision object used to perform floating point comparisons.
-
-