LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
NormalizedAngleInterval
represents closed intervals of normalized angles, i.e.
More...
#include <NormalizedAngleInterval.h>
Public Member Functions | |
NormalizedAngleInterval () | |
This constructor creates an empty interval. More... | |
NormalizedAngleInterval (Angle const &x) | |
This constructor creates a closed interval containing only the normalization of x. More... | |
NormalizedAngleInterval (NormalizedAngle const &x) | |
This constructor creates a closed interval containing only x. More... | |
NormalizedAngleInterval (Angle x, Angle y) | |
This constructor creates an interval from the given endpoints. More... | |
NormalizedAngleInterval (NormalizedAngle x, NormalizedAngle y) | |
This constructor creates an interval with the given endpoints. More... | |
bool | operator== (NormalizedAngleInterval const &i) const |
Two intervals are equal if they contain the same points. More... | |
bool | operator!= (NormalizedAngleInterval const &i) const |
bool | operator== (NormalizedAngle x) const |
A closed interval is equal to a point x if both endpoints equal x. More... | |
bool | operator!= (NormalizedAngle x) const |
NormalizedAngle | getA () const |
getA returns the first endpoint of this interval. More... | |
NormalizedAngle | getB () const |
getB returns the second endpoint of this interval. More... | |
bool | isEmpty () const |
isEmpty returns true if this interval does not contain any normalized angles. More... | |
bool | isFull () const |
isFull returns true if this interval contains all normalized angles. More... | |
bool | wraps () const |
wraps returns true if the interval "wraps" around the 0/2π angle discontinuity, i.e. More... | |
NormalizedAngle | getCenter () const |
getCenter returns the center of this interval. More... | |
NormalizedAngle | getSize () const |
getSize returns the size (length, width) of this interval. More... | |
NormalizedAngleInterval & | clipTo (NormalizedAngle x) |
clipTo shrinks this interval until all its points are in x. More... | |
NormalizedAngleInterval & | clipTo (NormalizedAngleInterval const &x) |
x.clipTo(y) sets x to the smallest interval containing the intersection of x and y. More... | |
NormalizedAngleInterval | clippedTo (NormalizedAngle x) const |
clippedTo returns the intersection of this interval and x. More... | |
NormalizedAngleInterval | clippedTo (NormalizedAngleInterval const &x) const |
clippedTo returns the smallest interval containing the intersection of this interval and x. More... | |
NormalizedAngleInterval | dilatedBy (Angle x) const |
For positive x, dilatedBy returns the morphological dilation of this interval by [-x,x]. More... | |
NormalizedAngleInterval | erodedBy (Angle x) const |
NormalizedAngleInterval & | dilateBy (Angle x) |
NormalizedAngleInterval & | erodeBy (Angle x) |
bool | contains (NormalizedAngle x) const |
bool | contains (NormalizedAngleInterval const &x) const |
bool | isDisjointFrom (NormalizedAngle x) const |
bool | isDisjointFrom (NormalizedAngleInterval const &x) const |
bool | intersects (NormalizedAngle x) const |
bool | intersects (NormalizedAngleInterval const &x) const |
bool | isWithin (NormalizedAngle x) const |
bool | isWithin (NormalizedAngleInterval const &x) const |
Relationship | relate (NormalizedAngle x) const |
Relationship | relate (NormalizedAngleInterval const &x) const |
NormalizedAngleInterval & | expandTo (NormalizedAngle x) |
NormalizedAngleInterval & | expandTo (NormalizedAngleInterval const &x) |
NormalizedAngleInterval | expandedTo (NormalizedAngle x) const |
NormalizedAngleInterval | expandedTo (NormalizedAngleInterval const &x) const |
Static Public Member Functions | |
static NormalizedAngleInterval | fromDegrees (double a, double b) |
static NormalizedAngleInterval | fromRadians (double a, double b) |
static NormalizedAngleInterval | empty () |
static NormalizedAngleInterval | full () |
NormalizedAngleInterval
represents closed intervals of normalized angles, i.e.
intervals of the unit circle.
A point on the unit circle is represented by the angle ∈ [0, 2π) between it and a reference point, and an interval by a pair of bounding points a and b. The points in the interval are traced out by counter-clockwise rotation of a around the circle until it reaches b. Because the endpoints are represented via normalized angles, a can be greater than b, indicating that the interval consists of the points represented by angles [a, 2π) ⋃ [0, b]. When this is the case, calling wraps()
on the interval will return true.
An interval with identical endpoints contains just that point, and is equal to that point.
An interval with NaN as either endpoint is empty, meaning that it contains no points on the unit circle. The interval [0, 2 * PI] is full, meaning that it contains all representable normalized angles in [0, 2π).
Definition at line 57 of file NormalizedAngleInterval.h.
|
inline |
This constructor creates an empty interval.
Definition at line 79 of file NormalizedAngleInterval.h.
|
inlineexplicit |
This constructor creates a closed interval containing only the normalization of x.
Definition at line 84 of file NormalizedAngleInterval.h.
|
inlineexplicit |
This constructor creates a closed interval containing only x.
Definition at line 87 of file NormalizedAngleInterval.h.
This constructor creates an interval from the given endpoints.
If both x and y lie in the range [0, 2π), then y may be less than x. For example, passing in x = 3π/2 and y = π/2 will result in an interval containing angles [3π/2, 2π) ⋃ [0, π/2]. Otherwise, x must be less than or equal to y, and the interval will correspond to the the set of angles produced by normalizing the elements of the interval [x, y].
Definition at line 35 of file NormalizedAngleInterval.cc.
|
inline |
This constructor creates an interval with the given endpoints.
Definition at line 99 of file NormalizedAngleInterval.h.
|
inline |
clippedTo
returns the intersection of this interval and x.
Definition at line 214 of file NormalizedAngleInterval.h.
|
inline |
clippedTo
returns the smallest interval containing the intersection of this interval and x.
The result is not always unique, and x.clippedTo(y)
is not guaranteed to equal y.clippedTo(x)
.
Definition at line 221 of file NormalizedAngleInterval.h.
|
inline |
clipTo
shrinks this interval until all its points are in x.
Definition at line 203 of file NormalizedAngleInterval.h.
NormalizedAngleInterval & lsst::sphgeom::NormalizedAngleInterval::clipTo | ( | NormalizedAngleInterval const & | x | ) |
x.clipTo(y)
sets x to the smallest interval containing the intersection of x and y.
The result is not always unique, and x.clipTo(y)
is not guaranteed to equal y.clipTo(x)
.
Definition at line 163 of file NormalizedAngleInterval.cc.
|
inline |
contains
returns true if the intersection of this interval and x is equal to x.
Definition at line 150 of file NormalizedAngleInterval.h.
bool lsst::sphgeom::NormalizedAngleInterval::contains | ( | NormalizedAngleInterval const & | x | ) | const |
contains
returns true if the intersection of this interval and x is equal to x.
Definition at line 54 of file NormalizedAngleInterval.cc.
|
inline |
Definition at line 253 of file NormalizedAngleInterval.h.
NormalizedAngleInterval lsst::sphgeom::NormalizedAngleInterval::dilatedBy | ( | Angle | x | ) | const |
For positive x, dilatedBy
returns the morphological dilation of this interval by [-x,x].
For negative x, it returns the morphological erosion of this interval by [x,-x]. If x is zero or NaN, or this interval is empty, there is no effect.
Definition at line 232 of file NormalizedAngleInterval.cc.
|
inlinestatic |
Definition at line 69 of file NormalizedAngleInterval.h.
|
inline |
Definition at line 258 of file NormalizedAngleInterval.h.
|
inline |
Definition at line 251 of file NormalizedAngleInterval.h.
|
inline |
expandedTo
returns the smallest interval containing the union of this interval and x. The result is not always unique, and x.expandedTo(y)
is not guaranteed to equal y.expandedTo(x)
.
Definition at line 237 of file NormalizedAngleInterval.h.
|
inline |
expandedTo
returns the smallest interval containing the union of this interval and x. The result is not always unique, and x.expandedTo(y)
is not guaranteed to equal y.expandedTo(x)
.
Definition at line 241 of file NormalizedAngleInterval.h.
NormalizedAngleInterval & lsst::sphgeom::NormalizedAngleInterval::expandTo | ( | NormalizedAngle | x | ) |
expandTo
minimally expands this interval to contain x. The result is not always unique, and x.expandTo(y)
is not guaranteed to equal y.expandTo(x)
.
Definition at line 189 of file NormalizedAngleInterval.cc.
NormalizedAngleInterval & lsst::sphgeom::NormalizedAngleInterval::expandTo | ( | NormalizedAngleInterval const & | x | ) |
expandTo
minimally expands this interval to contain x. The result is not always unique, and x.expandTo(y)
is not guaranteed to equal y.expandTo(x)
.
Definition at line 204 of file NormalizedAngleInterval.cc.
|
inlinestatic |
Definition at line 60 of file NormalizedAngleInterval.h.
|
inlinestatic |
Definition at line 65 of file NormalizedAngleInterval.h.
|
inlinestatic |
Definition at line 73 of file NormalizedAngleInterval.h.
|
inline |
getA
returns the first endpoint of this interval.
Definition at line 119 of file NormalizedAngleInterval.h.
|
inline |
getB
returns the second endpoint of this interval.
Definition at line 122 of file NormalizedAngleInterval.h.
|
inline |
getCenter
returns the center of this interval.
It is NaN for empty intervals, and arbitrary for full intervals.
Definition at line 139 of file NormalizedAngleInterval.h.
|
inline |
getSize
returns the size (length, width) of this interval.
It is zero for single-point intervals, and NaN for empty intervals. Note that due to rounding errors, an interval with size 2 * PI
is not necessarily full, and an interval with size 0 may contain more than a single point.
Definition at line 145 of file NormalizedAngleInterval.h.
|
inline |
|
inline |
intersects
returns true if the intersection of this interval and x is non-empty.
Definition at line 177 of file NormalizedAngleInterval.h.
|
inline |
isDisjointFrom
returns true if the intersection of this interval and x is empty.
Definition at line 163 of file NormalizedAngleInterval.h.
bool lsst::sphgeom::NormalizedAngleInterval::isDisjointFrom | ( | NormalizedAngleInterval const & | x | ) | const |
isDisjointFrom
returns true if the intersection of this interval and x is empty.
Definition at line 73 of file NormalizedAngleInterval.cc.
|
inline |
isEmpty
returns true if this interval does not contain any normalized angles.
Definition at line 126 of file NormalizedAngleInterval.h.
|
inline |
isFull
returns true if this interval contains all normalized angles.
Definition at line 129 of file NormalizedAngleInterval.h.
|
inline |
isWithin
returns true if the intersection of this interval and x is this interval.
Definition at line 185 of file NormalizedAngleInterval.h.
|
inline |
isWithin
returns true if the intersection of this interval and x is this interval.
Definition at line 189 of file NormalizedAngleInterval.h.
|
inline |
Definition at line 116 of file NormalizedAngleInterval.h.
|
inline |
Definition at line 107 of file NormalizedAngleInterval.h.
|
inline |
|
inline |
Two intervals are equal if they contain the same points.
Definition at line 103 of file NormalizedAngleInterval.h.
Relationship lsst::sphgeom::NormalizedAngleInterval::relate | ( | NormalizedAngle | x | ) | const |
relate
returns a bitset S describing the spatial relationships between this interval and x. For each relation that holds, the bitwise AND of S and the corresponding Relationship will be non-zero.
Definition at line 88 of file NormalizedAngleInterval.cc.
Relationship lsst::sphgeom::NormalizedAngleInterval::relate | ( | NormalizedAngleInterval const & | x | ) | const |
relate
returns a bitset S describing the spatial relationships between this interval and x. For each relation that holds, the bitwise AND of S and the corresponding Relationship will be non-zero.
Definition at line 107 of file NormalizedAngleInterval.cc.
|
inline |
wraps
returns true if the interval "wraps" around the 0/2π angle discontinuity, i.e.
consists of [getA(), 2π) ∪ [0, getB()]
.
Definition at line 135 of file NormalizedAngleInterval.h.