lsst.sphgeom
20.0.0-1-g009f3de
|
Go to the documentation of this file.
23 #ifndef LSST_SPHGEOM_ELLIPSE_H_
24 #define LSST_SPHGEOM_ELLIPSE_H_
171 static constexpr uint8_t TYPE_CODE =
'e';
183 _tana(std::numeric_limits<double>::infinity()),
184 _tanb(std::numeric_limits<double>::infinity())
212 bool operator==(
Ellipse const & e)
const {
213 return _S == e._S && _a == e._a && _b == e._b;
216 bool operator!=(
Ellipse const & e)
const {
return !(*
this == e); }
218 bool isEmpty()
const {
return Angle(0.5 * PI) + _a < _gamma; }
220 bool isFull()
const {
return Angle(0.5 * PI) - _a <= _gamma; }
222 bool isGreatCircle()
const {
return _a.
asRadians() == 0.0; }
224 bool isCircle()
const {
return _a == _b; }
264 _S =
Matrix3d(-_S(0,0), -_S(0,1), -_S(0,2),
265 _S(1,0), _S(1,1), _S(1,2),
266 -_S(2,0), -_S(2,1), -_S(2,2));
276 std::unique_ptr<Region>
clone()
const override {
277 return std::unique_ptr<Ellipse>(
new Ellipse(*
this));
296 std::vector<uint8_t>
encode()
const override;
300 static std::unique_ptr<Ellipse>
decode(std::vector<uint8_t>
const & s) {
301 return decode(s.data(), s.size());
303 static std::unique_ptr<Ellipse>
decode(uint8_t
const * buffer,
size_t n);
307 static constexpr
size_t ENCODED_SIZE = 113;
317 std::ostream & operator<<(std::ostream &, Ellipse
const &);
321 #endif // LSST_SPHGEOM_ELLIPSE_H_
Ellipse()
This constructor creates an empty ellipse.
Definition: Ellipse.h:178
This file declares a class for representing circular regions on the unit sphere.
Relationship relate(Region const &r) const override
Definition: Ellipse.h:286
Ellipse complemented() const
complemented returns the closure of the complement of this ellipse.
Definition: Ellipse.h:273
static std::unique_ptr< Ellipse > decode(std::vector< uint8_t > const &s)
Definition: Ellipse.h:300
bool contains(UnitVector3d const &v) const override
contains tests whether the given unit vector is inside this region.
Definition: Ellipse.cc:160
Box3d getBoundingBox3d() const override
getBoundingBox3d returns a 3-dimensional bounding-box for this region.
Definition: Ellipse.cc:237
Definition: ConvexPolygon.h:57
A 3x3 matrix with real entries stored in double precision.
Definition: Matrix3d.h:38
std::vector< uint8_t > encode() const override
Definition: Ellipse.cc:339
Definition: Ellipse.h:169
Relationship invert(Relationship r)
Definition: Relationship.h:55
UnitVector3d getCenter() const
getCenter returns the center of the ellipse as a unit vector.
Definition: Ellipse.h:232
double asRadians() const
asRadians returns the value of this angle in units of radians.
Definition: Angle.h:85
std::bitset< 3 > Relationship
Relationship describes how two sets are related.
Definition: Relationship.h:35
UnitVector3d getF2() const
getF2 returns the second focal point of the ellipse.
Definition: Ellipse.h:243
This file declares a class for representing unit vectors in ℝ³.
Circle getBoundingCircle() const override
getBoundingCircle returns a bounding-circle for this region.
Definition: Ellipse.cc:241
UnitVector3d rotatedAround(UnitVector3d const &k, Angle a) const
Definition: UnitVector3d.h:193
Ellipse(Circle const &c)
This constructor creates an ellipse corresponding to the given circle.
Definition: Ellipse.h:188
This file defines an interface for spherical regions.
static UnitVector3d fromNormalized(Vector3d const &v)
Definition: UnitVector3d.h:82
Matrix3d const & getTransformMatrix() const
Definition: Ellipse.h:229
std::unique_ptr< Region > clone() const override
clone returns a deep copy of this region.
Definition: Ellipse.h:276
UnitVector3d getF1() const
getF1 returns the first focal point of the ellipse.
Definition: Ellipse.h:237
Angle getBeta() const
Definition: Ellipse.h:256
Angle getAlpha() const
Definition: Ellipse.h:251
Angle getGamma() const
Definition: Ellipse.h:260
UnitVector3d const & getCenter() const
Definition: Circle.h:118
Ellipse(UnitVector3d const &v, Angle alpha=Angle(0.0))
Definition: Ellipse.h:194
virtual Relationship relate(Region const &) const =0
Angle getOpeningAngle() const
Definition: Circle.h:128
Ellipse & complement()
complement sets this ellipse to the closure of its complement.
Definition: Ellipse.h:263
Definition: UnitVector3d.h:55
Box getBoundingBox() const override
getBoundingBox returns a bounding-box for this region.
Definition: Ellipse.cc:190
This file contains a class representing 3x3 real matrices.