public class AngularInterval extends Object implements HyperplaneBoundedRegion<Point1S>
2pi
. The interval is
defined by two azimuth angles: a min and a max. The interval starts at the min azimuth angle and
contains all points in the direction of increasing azimuth angles up to max.
Instances of this class are guaranteed to be immutable.
Modifier and Type | Class and Description |
---|---|
static class |
AngularInterval.Convex
Class representing an angular interval with the additional property that the
region is convex.
|
Modifier and Type | Method and Description |
---|---|
RegionLocation |
classify(Point1S pt) |
static AngularInterval.Convex |
full()
Return an instance representing the full space.
|
double |
getBoundarySize() |
Point1S |
getCentroid() |
double |
getMax()
Get the maximum azimuth angle for the interval, or
2pi if
the interval represents the full space. |
CutAngle |
getMaxBoundary()
Get the maximum point for the interval.
|
Point1S |
getMidPoint()
Get the midpoint of the interval or null if the interval represents
the full space.
|
double |
getMin()
Get the minimum azimuth angle for the interval, or
0
if the interval is full. |
CutAngle |
getMinBoundary()
Get the minimum boundary for the interval, or null if the
interval represents the full space.
|
double |
getSize() |
boolean |
isEmpty() |
boolean |
isFull() |
static AngularInterval |
of(CutAngle a,
CutAngle b)
Return an instance representing the angular interval between the given oriented points.
|
static AngularInterval |
of(double min,
double max,
Precision.DoubleEquivalence precision)
Return an instance representing the angular interval between the given min and max azimuth
values.
|
static AngularInterval |
of(Point1S min,
Point1S max,
Precision.DoubleEquivalence precision)
Return an instance representing the angular interval between the given min and max azimuth
points.
|
Point1S |
project(Point1S pt) |
Split<RegionBSPTree1S> |
split(Hyperplane<Point1S> splitter) |
List<AngularInterval.Convex> |
toConvex()
Return a list of convex intervals comprising this region.
|
String |
toString() |
RegionBSPTree1S |
toTree()
Return a
RegionBSPTree1S instance representing the same region
as this instance. |
AngularInterval |
transform(Transform<Point1S> transform)
Return a new instance transformed by the argument.
|
boolean |
wrapsZero()
Return true if the interval wraps around the zero/
2pi point. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isFinite, isInfinite
public double getMin()
0
if the interval is full.0
if the interval represents the full space.public CutAngle getMinBoundary()
public double getMax()
2pi
if
the interval represents the full space.2pi
if
the interval represents the full space.public CutAngle getMaxBoundary()
public Point1S getMidPoint()
getCentroid()
public boolean isEmpty()
This method always returns false.
public double getBoundarySize()
This method simply returns 0 because boundaries in one dimension do not have any size.
getBoundarySize
in interface Region<Point1S>
public Point1S getCentroid()
This method is an alias for getMidPoint()
.
getCentroid
in interface Region<Point1S>
getMidPoint()
public RegionLocation classify(Point1S pt)
public boolean wrapsZero()
2pi
point. In this
case, the max boundary azimuth is less than that of the min boundary when both
values are normalized to the range [0, 2pi)
.2pi
pointpublic AngularInterval transform(Transform<Point1S> transform)
transform
- transform to applypublic Split<RegionBSPTree1S> split(Hyperplane<Point1S> splitter)
This method returns instances of RegionBSPTree1S
instead of
AngularInterval
since it is possible for a convex angular interval
to be split into disjoint regions by a single hyperplane. These disjoint
regions cannot be represented by this class and require the use of a BSP
tree.
split
in interface Splittable<Point1S,HyperplaneBoundedRegion<Point1S>>
RegionBSPTree1S.split(Hyperplane)
public RegionBSPTree1S toTree()
RegionBSPTree1S
instance representing the same region
as this instance.public List<AngularInterval.Convex> toConvex()
AngularInterval.Convex
public static AngularInterval.Convex full()
public static AngularInterval of(double min, double max, Precision.DoubleEquivalence precision)
2pi
. 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.min
- min azimuth valuemax
- max azimuth valueprecision
- precision precision context used to compare floating point valuesIllegalArgumentException
- if either azimuth is infinite or NaNpublic static AngularInterval of(Point1S min, Point1S max, Precision.DoubleEquivalence precision)
2pi
. 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.min
- min azimuth valuemax
- max azimuth valueprecision
- precision precision context used to compare floating point valuesIllegalArgumentException
- if either azimuth is infinite or NaNpublic static AngularInterval of(CutAngle a, CutAngle b)
a
- first oriented pointb
- second oriented pointIllegalArgumentException
- if either argument is infinite or NaNCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.