#include <Circle.h>
Public Member Functions | |
| Circle () | |
| This constructor creates an empty circle. | |
| Circle (UnitVector3d const &c) | |
| Circle (UnitVector3d const &c, Angle a) | |
| Circle (UnitVector3d const &c, double cl2) | |
| bool | operator== (Circle const &c) const |
| bool | operator!= (Circle const &c) const |
| bool | isEmpty () const override |
| bool | isFull () const |
| UnitVector3d const & | getCenter () const |
| double | getSquaredChordLength () const |
| Angle | getOpeningAngle () const |
| bool | contains (Circle const &x) const |
| Circle & | dilateBy (Angle r) |
| Circle | dilatedBy (Angle r) const |
| Circle & | erodeBy (Angle r) |
| Circle | erodedBy (Angle r) const |
| double | getArea () const |
getArea returns the area of this circle in steradians. | |
| Circle & | complement () |
| Circle | complemented () const |
complemented returns the closure of the complement of this circle. | |
| Relationship | relate (UnitVector3d const &v) const |
| std::unique_ptr< Region > | clone () const override |
| Box | getBoundingBox () const override |
| Box3d | getBoundingBox3d () const override |
| Circle | getBoundingCircle () const override |
| bool | contains (UnitVector3d const &v) const override |
| Relationship | relate (Region const &r) const override |
| Relationship | relate (Box const &) const override |
| Relationship | relate (Circle const &) const override |
| Relationship | relate (ConvexPolygon const &) const override |
| Relationship | relate (Ellipse const &) const override |
| TriState | overlaps (Region const &other) const override |
| TriState | overlaps (Box const &) const override |
| TriState | overlaps (Circle const &) const override |
| TriState | overlaps (ConvexPolygon const &) const override |
| TriState | overlaps (Ellipse const &) const override |
| std::vector< std::uint8_t > | encode () const override |
| bool | isDisjointFrom (UnitVector3d const &x) const |
| bool | isDisjointFrom (Circle const &x) const |
| bool | intersects (UnitVector3d const &x) const |
| bool | intersects (Circle const &x) const |
| bool | isWithin (UnitVector3d const &) const |
| bool | isWithin (Circle const &x) const |
| Circle & | clipTo (UnitVector3d const &x) |
| Circle & | clipTo (Circle const &x) |
| Circle | clippedTo (UnitVector3d const &x) const |
| Circle | clippedTo (Circle const &x) const |
| Circle & | expandTo (UnitVector3d const &x) |
| Circle & | expandTo (Circle const &x) |
| Circle | expandedTo (UnitVector3d const &x) const |
| Circle | expandedTo (Circle const &x) const |
Public Member Functions inherited from lsst.sphgeom._continue_class.Region | |
| Region | from_ivoa_pos (cls, str pos) |
| str | to_ivoa_pos (self) |
Static Public Member Functions | |
| static Circle | empty () |
| static Circle | full () |
| static double | squaredChordLengthFor (Angle openingAngle) |
| static Angle | openingAngleFor (double squaredChordLength) |
| static std::unique_ptr< Circle > | decode (std::vector< std::uint8_t > const &s) |
| static std::unique_ptr< Circle > | decode (std::uint8_t const *buffer, size_t n) |
Static Public Attributes | |
| static constexpr std::uint8_t | TYPE_CODE = 'c' |
Circle is a circular region on the unit sphere that contains its boundary. Internally, the circle is represented by its center vector and the squared length of the chords between its center and points on its boundary. This yields a fast point-in-circle test but, unlike a representation that uses the center vector and cosine of the circle opening angle, remains accurate for circles with very small opening angles.
|
inlineexplicit |
This constructor creates the circle with center c and squared chord length / opening angle of zero. Because of rounding error, (v - c).squaredNorm() == 0.0 does not imply that v == c. Therefore calling contains(v) on the resulting circle may return true for unit vectors v != c.
|
inline |
This constructor creates a circle with center c and opening angle a. If a is negative or NaN, the circle will be empty, and if a is greater than or equal to PI, the circle will be full.
|
inline |
This constructor creates a circle with center c and squared chord length cl2. If cl2 is negative or NaN, the circle will be empty, and if cl2 is greater than or equal to 4, the circle will be full.
|
inline |
clippedTo returns the minimal bounding circle for the intersection of this circle and x.
| Circle & lsst::sphgeom::Circle::clipTo | ( | UnitVector3d const & | x | ) |
clipTo sets this circle to the minimal bounding circle for the intersection of this circle and x.
| Circle & lsst::sphgeom::Circle::complement | ( | ) |
complement sets this circle to the closure of its complement. Note that both the empty circle as well as all circles containing a single point are mapped to a full circle, so that taking the complement of a circle twice is not guaranteed to reproduce the original circle, even in the absence of rounding error.
| bool lsst::sphgeom::Circle::contains | ( | Circle const & | x | ) | const |
contains returns true if the intersection of this circle and x is equal to x.
|
inlinestatic |
decode deserializes a Circle from a byte string produced by encode.
If r is positive, dilateBy increases the opening angle of this circle to include all points within angle r of its boundary. If r is negative, it decreases the opening angle to exclude those points instead.
If this circle is empty or full, or r is zero or NaN, there is no effect.
|
inline |
expandedTo returns the minimal bounding circle for the union of this circle and x.
| Circle & lsst::sphgeom::Circle::expandTo | ( | UnitVector3d const & | x | ) |
expandTo minimally expands this circle to contain x.
|
inline |
getCenter returns the center of this circle as a unit vector. It is arbitrary for empty and full circles.
|
inline |
getOpeningAngle returns the opening angle of this circle - that is, the angle between its center vector and points on its boundary. It is negative or NaN for empty circles, and at least PI for full circles.
|
inline |
getSquaredChordLength returns the squared length of chords between the circle center and points on the circle boundary. It is negative or NaN for empty circles, and at least 4 for full circles.
|
inline |
intersects returns true if the intersection of this circle and x is non-empty.
|
inline |
isDisjointFrom returns true if the intersection of this circle and x is empty.
|
inline |
isWithin returns true if the intersection of this circle and x is this circle.
|
static |
openingAngleFor computes and returns the angular separation between points in S² that are separated by the given squared chord length. The squared chord length l² and angle θ are related by l² = 4 sin²(θ/2).
|
static |
squaredChordLengthFor computes and returns the squared chord length between points in S² that are separated by the given angle. The squared chord length l² and angle θ are related by l² = 4 sin²(θ/2).