LSSTApplications
19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
42 if (
a.asRadians() < 0.0) {
45 if (
a.asRadians() >=
PI) {
48 double s =
sin(0.5 *
a);
55 if (squaredChordLength < 0.0) {
58 if (squaredChordLength >= 4.0) {
72 return _openingAngle >
84 return cc > _openingAngle +
x._openingAngle +
132 Angle o = 0.5 * (cx + _openingAngle);
133 Angle r = 0.5 * (cx - _openingAngle);
163 Angle o = 0.5 * (cc + _openingAngle +
x._openingAngle);
174 Angle r = o - _openingAngle;
187 Angle o = _openingAngle + r;
197 _squaredChordLength = 4.0;
201 _squaredChordLength = -1.0;
202 _openingAngle =
Angle(-1.0);
205 _squaredChordLength = 4.0 - _squaredChordLength;
206 _openingAngle =
Angle(
PI) - _openingAngle;
220 static double const MAX_BOUNDARY_ERROR = 6.2e-16;
245 double s =
sin(_openingAngle);
246 double c =
cos(_openingAngle);
247 for (
int i = 0; i < 3; ++i) {
248 double ci = _center(i);
250 double bmin = 1.0, bmax = -1.0;
251 if (2.0 - 2.0 * ci <= _squaredChordLength) {
254 if (2.0 + 2.0 * ci <= _squaredChordLength) {
257 double b0 = ci * c + di * s;
258 bmax =
std::max(bmax, b0 + MAX_BOUNDARY_ERROR);
259 bmin =
std::min(bmin, b0 - MAX_BOUNDARY_ERROR);
260 double b1 = ci * c - di * s;
261 bmax =
std::max(bmax, b1 + MAX_BOUNDARY_ERROR);
262 bmin =
std::min(bmin, b1 - MAX_BOUNDARY_ERROR);
265 return Box3d(e[0], e[1], e[2]);
272 return DISJOINT | WITHIN;
279 return invert(
b.relate(*
this));
285 return CONTAINS | DISJOINT | WITHIN;
287 return DISJOINT | WITHIN;
289 return CONTAINS | DISJOINT;
294 return CONTAINS | WITHIN;
338 if (buffer ==
nullptr || n != ENCODED_SIZE || *buffer !=
TYPE_CODE) {
346 double squaredChordLength =
decodeDouble(buffer); buffer += 8;
347 double openingAngle =
decodeDouble(buffer); buffer += 8;
349 circle->_squaredChordLength = squaredChordLength;
350 circle->_openingAngle =
Angle(openingAngle);
357 return os <<
"{\"Circle\": [" << c.
getCenter() << tail;
This file declares a class for representing elliptical regions on the unit sphere.
Circle()
This constructor creates an empty circle.
Circle & dilateBy(Angle r)
If r is positive, dilateBy increases the opening angle of this circle to include all points within an...
This file declares a class for representing axis-aligned bounding boxes in ℝ³.
double sin(Angle const &a)
Circle & complement()
complement sets this circle to the closure of its complement.
static double squaredChordLengthFor(Angle openingAngle)
squaredChordLengthFor computes and returns the squared chord length between points in S² that are sep...
This file declares a class for representing longitude/latitude angle boxes on the unit sphere.
double asRadians() const
asRadians returns the value of this angle in units of radians.
static constexpr uint8_t TYPE_CODE
LonLat represents a spherical coordinate (longitude/latitude angle) pair.
Relationship relate(UnitVector3d const &v) const
Box represents a rectangle in spherical coordinate space that contains its boundary.
Circle & clipTo(UnitVector3d const &x)
bool isDisjointFrom(UnitVector3d const &x) const
This file contains simple helper functions for encoding and decoding primitive types to/from byte str...
Interval1d represents closed intervals of ℝ.
This file declares a class for representing circular regions on the unit sphere.
Box3d represents a box in ℝ³.
UnitVector3d is a unit vector in ℝ³ with components stored in double precision.
Circle & expandTo(UnitVector3d const &x)
ConvexPolygon is a closed convex polygon on the unit sphere.
static NormalizedAngle halfWidthForCircle(Angle r, Angle lat)
halfWidthForCircle computes the half-width of bounding boxes for circles with radius r and centers at...
Box getBoundingBox() const override
getBoundingBox returns a bounding-box for this region.
Ellipse is an elliptical region on the sphere.
double getSquaredChordLength() const
getSquaredChordLength returns the squared length of chords between the circle center and points on th...
Vector3d cross(Vector3d const &v) const
cross returns the cross product of this unit vector and v.
Box3d getBoundingBox3d() const override
getBoundingBox3d returns a 3-dimensional bounding-box for this region.
A base class for image defects.
Relationship relate(Region const &r) const override
double decodeDouble(uint8_t const *buffer)
decode extracts an IEEE double from the 8 byte little-endian byte sequence in buffer.
std::vector< uint8_t > encode() const override
encode serializes this region into an opaque byte string.
bool contains(Circle const &x) const
contains returns true if the intersection of this circle and x is equal to x.
static Box3d aroundUnitSphere()
aroundUnitSphere returns a minimal Box3d containing the unit sphere.
static std::unique_ptr< Circle > decode(std::vector< uint8_t > const &s)
Angle represents an angle in radians.
static UnitVector3d orthogonalTo(Vector3d const &v)
orthogonalTo returns an arbitrary unit vector that is orthogonal to v.
Relationship relate(Region const &r) const override
std::ostream & operator<<(std::ostream &, Angle const &)
UnitVector3d const & getCenter() const
getCenter returns the center of this circle as a unit vector.
Circle is a circular region on the unit sphere that contains its boundary.
NormalizedAngle is an angle that lies in the range [0, 2π), with one exception - a NormalizedAngle ca...
constexpr double MAX_ASIN_ERROR
static Angle openingAngleFor(double squaredChordLength)
openingAngleFor computes and returns the angular separation between points in S² that are separated b...
static UnitVector3d fromNormalized(Vector3d const &v)
fromNormalized returns the unit vector equal to v, which is assumed to be normalized.
double cos(Angle const &a)
Relationship invert(Relationship r)
Given the relationship between two sets A and B (i.e.
This file declares a class for representing convex polygons with great circle edges on the unit spher...
void encodeDouble(double item, std::vector< uint8_t > &buffer)
encode appends an IEEE double in little-endian byte order to the end of buffer.