Class AngularInterval.Convex
- java.lang.Object
-
- org.apache.commons.geometry.spherical.oned.AngularInterval
-
- org.apache.commons.geometry.spherical.oned.AngularInterval.Convex
-
- All Implemented Interfaces:
HyperplaneBoundedRegion<Point1S>
,Splittable<Point1S,HyperplaneBoundedRegion<Point1S>>
,Region<Point1S>
,Sized
- Enclosing class:
- AngularInterval
public static final class AngularInterval.Convex extends AngularInterval
Class representing an angular interval with the additional property that the region is convex. By convex, it is meant that the shortest path between any two points in the region is also contained entirely in the region. If there is a tie for shortest path, then it is sufficient that at least one lie entirely within the region. For spherical 1D space, this means that the angular interval is either completely full or has a length less than or equal topi
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.commons.geometry.spherical.oned.AngularInterval
AngularInterval.Convex
-
-
Field Summary
Fields Modifier and Type Field Description private static AngularInterval.Convex
FULL
Interval instance representing the full space.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AngularInterval.Convex
of(double min, double max, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Return an instance representing the convex angular interval between the given min and max azimuth values.static AngularInterval.Convex
of(CutAngle a, CutAngle b)
Return an instance representing the convex angular interval between the given oriented points.static AngularInterval.Convex
of(Point1S min, Point1S max, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Return an instance representing the convex angular interval between the given min and max azimuth points.Split<AngularInterval.Convex>
splitDiameter(CutAngle splitter)
Split the instance along a circle diameter.The diameter is defined by the given split point and its reversed antipodal point.java.util.List<AngularInterval.Convex>
toConvex()
Return a list of convex intervals comprising this region.AngularInterval.Convex
transform(Transform<Point1S> transform)
Return a new instance transformed by the argument.-
Methods inherited from class org.apache.commons.geometry.spherical.oned.AngularInterval
classify, full, getBoundarySize, getCentroid, getMax, getMaxBoundary, getMidPoint, getMin, getMinBoundary, getSize, isEmpty, isFull, project, split, toString, toTree, wrapsZero
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.commons.geometry.core.Sized
isFinite, isInfinite
-
-
-
-
Field Detail
-
FULL
private static final AngularInterval.Convex FULL
Interval instance representing the full space.
-
-
Constructor Detail
-
Convex
private Convex(CutAngle minBoundary, CutAngle maxBoundary)
Construct a new convex instance from its boundaries and midpoint. No validation of the argument is performed. Callers are responsible for ensuring that the size of interval is less than or equal topi
.- Parameters:
minBoundary
- minimum boundary for the intervalmaxBoundary
- maximum boundary for the interval- Throws:
java.lang.IllegalArgumentException
- if the interval is not convex
-
-
Method Detail
-
toConvex
public java.util.List<AngularInterval.Convex> toConvex()
Return a list of convex intervals comprising this region.- Overrides:
toConvex
in classAngularInterval
- Returns:
- a list of convex intervals comprising this region
- See Also:
AngularInterval.Convex
-
transform
public AngularInterval.Convex transform(Transform<Point1S> transform)
Return a new instance transformed by the argument. If the transformed size of the interval is greater than or equal to 2pi, then an interval representing the full space is returned.- Overrides:
transform
in classAngularInterval
- Parameters:
transform
- transform to apply- Returns:
- a new instance transformed by the argument
-
splitDiameter
public Split<AngularInterval.Convex> splitDiameter(CutAngle splitter)
Split the instance along a circle diameter.The diameter is defined by the given split point and its reversed antipodal point.- Parameters:
splitter
- split point defining one side of the split diameter- Returns:
- result of the split operation
-
of
public static AngularInterval.Convex of(double min, double max, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Return an instance representing the convex angular interval between the given min and max azimuth values. The max value is adjusted to be numerically above the min value, even if the resulting azimuth value is greater than or equal to2pi
. An instance representing the full space is returned if either point is infinite or min and max are equivalent as evaluated by the given precision context.- Parameters:
min
- min azimuth valuemax
- max azimuth valueprecision
- precision precision context used to compare floating point values- Returns:
- a new instance resulting the angular region between the given min and max azimuths
- Throws:
java.lang.IllegalArgumentException
- if either azimuth is infinite or NaN, or the given angular interval is not convex (meaning it has a size of greater thanpi
)
-
of
public static AngularInterval.Convex of(Point1S min, Point1S max, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Return an instance representing the convex angular interval between the given min and max azimuth points. The max point is adjusted to be numerically above the min point, even if the resulting azimuth value is greater than or equal to2pi
. An instance representing the full space is returned if either point is infinite or min and max are equivalent as evaluated by the given precision context.- Parameters:
min
- min azimuth valuemax
- max azimuth valueprecision
- precision precision context used to compare floating point values- Returns:
- a new instance resulting the angular region between the given min and max points
- Throws:
java.lang.IllegalArgumentException
- if either azimuth is infinite or NaN, or the given angular interval is not convex (meaning it has a size of greater thanpi
)
-
of
public static AngularInterval.Convex of(CutAngle a, CutAngle b)
Return an instance representing the convex angular interval between the given oriented points. The negative-facing point is used as the minimum boundary and the positive-facing point is adjusted to be above the minimum. The arguments can be given in any order. The full space is returned if the points are equivalent or are oriented in the same direction.- Parameters:
a
- first oriented pointb
- second oriented point- Returns:
- an instance representing the angular interval between the given oriented points
- Throws:
java.lang.IllegalArgumentException
- if either azimuth is infinite or NaN, or the given angular interval is not convex (meaning it has a size of greater thanpi
)
-
-