LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
23 #ifndef LSST_SPHGEOM_CIRCLE_H_
24 #define LSST_SPHGEOM_CIRCLE_H_
67 _squaredChordLength(-1.0),
78 _squaredChordLength(0.0),
96 _squaredChordLength(cl2),
103 (_center == c._center &&
104 _squaredChordLength == c._squaredChordLength &&
105 _openingAngle == c._openingAngle);
111 return !(_squaredChordLength >= 0.0);
114 bool isFull()
const {
return _squaredChordLength >= 4.0; }
166 return Circle(*this).clipTo(
x);
170 return Circle(*this).clipTo(
x);
184 return Circle(*this).expandTo(
x);
188 return Circle(*this).expandTo(
x);
232 (v - _center).getSquaredNorm() <= _squaredChordLength;
256 static constexpr
size_t ENCODED_SIZE = 41;
259 double _squaredChordLength;
267 #endif // LSST_SPHGEOM_CIRCLE_H_
Circle(UnitVector3d const &c, double cl2)
This constructor creates a circle with center c and squared chord length cl2.
Circle()
This constructor creates an empty circle.
This file defines an interface for spherical regions.
bool intersects(UnitVector3d const &x) const
Circle & dilateBy(Angle r)
If r is positive, dilateBy increases the opening angle of this circle to include all points within an...
Circle getBoundingCircle() const override
getBoundingCircle returns a bounding-circle for this region.
virtual Relationship relate(Region const &) const =0
std::unique_ptr< Region > clone() const override
clone returns a deep copy of this region.
Circle & complement()
complement sets this circle to the closure of its complement.
Region is a minimal interface for 2-dimensional regions on the unit sphere.
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 unit vectors in ℝ³.
static constexpr uint8_t TYPE_CODE
double getArea() const
getArea returns the area of this circle in steradians.
Relationship relate(UnitVector3d const &v) const
Box represents a rectangle in spherical coordinate space that contains its boundary.
bool isWithin(UnitVector3d const &) const
bool intersects(Circle const &x) const
Circle & clipTo(UnitVector3d const &x)
bool isDisjointFrom(UnitVector3d const &x) const
Circle erodedBy(Angle r) const
Circle complemented() const
complemented returns the closure of the complement of this circle.
bool operator==(Circle const &c) const
Circle(UnitVector3d const &c)
This constructor creates the circle with center c and squared chord length / opening angle of zero.
Box3d represents a box in ℝ³.
Circle & erodeBy(Angle r)
Relationship relate(Region const &r) const override
bool operator!=(Circle const &c) const
UnitVector3d is a unit vector in ℝ³ with components stored in double precision.
bool isWithin(Circle const &x) const
Circle & expandTo(UnitVector3d const &x)
Angle getOpeningAngle() const
getOpeningAngle returns the opening angle of this circle - that is, the angle between its center vect...
ConvexPolygon is a closed convex polygon on the unit sphere.
Circle expandedTo(UnitVector3d const &x) const
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...
Box3d getBoundingBox3d() const override
getBoundingBox3d returns a 3-dimensional bounding-box for this region.
A base class for image defects.
Circle(UnitVector3d const &c, Angle a)
This constructor creates a circle with center c and opening angle a.
Circle clippedTo(UnitVector3d const &x) const
std::vector< uint8_t > encode() const override
encode serializes this region into an opaque byte string.
Circle expandedTo(Circle const &x) const
bool contains(Circle const &x) const
contains returns true if the intersection of this circle and x is equal to x.
static std::unique_ptr< Circle > decode(std::vector< uint8_t > const &s)
bool contains(UnitVector3d const &v) const override
contains tests whether the given unit vector is inside this region.
Angle represents an angle in radians.
std::ostream & operator<<(std::ostream &, Angle const &)
Circle clippedTo(Circle const &x) 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.
Circle dilatedBy(Angle r) const
static Angle openingAngleFor(double squaredChordLength)
openingAngleFor computes and returns the angular separation between points in S² that are separated b...
Relationship invert(Relationship r)
Given the relationship between two sets A and B (i.e.