30#ifndef LSST_SPHGEOM_ELLIPSE_H_
31#define LSST_SPHGEOM_ELLIPSE_H_
191 _tana(
std::numeric_limits<double>::infinity()),
192 _tanb(
std::numeric_limits<double>::infinity())
221 return _S == e._S && _a == e._a && _b == e._b;
272 _S =
Matrix3d(-_S(0,0), -_S(0,1), -_S(0,2),
273 _S(1,0), _S(1,1), _S(1,2),
274 -_S(2,0), -_S(2,1), -_S(2,2));
311 return decode(s.data(), s.size());
317 static constexpr size_t ENCODED_SIZE = 113;
This file declares a class for representing circular regions on the unit sphere.
This file contains a class representing 3x3 real matrices.
This file defines an interface for spherical regions.
This file declares a class for representing unit vectors in ℝ³.
Angle represents an angle in radians.
double asRadians() const
asRadians returns the value of this angle in units of radians.
Box3d represents a box in ℝ³.
Box represents a rectangle in spherical coordinate space that contains its boundary.
Circle is a circular region on the unit sphere that contains its boundary.
Angle getOpeningAngle() const
getOpeningAngle returns the opening angle of this circle - that is, the angle between its center vect...
UnitVector3d const & getCenter() const
getCenter returns the center of this circle as a unit vector.
ConvexPolygon is a closed convex polygon on the unit sphere.
Ellipse is an elliptical region on the sphere.
static constexpr uint8_t TYPE_CODE
Angle getAlpha() const
getAlpha returns α, the first semi-axis length of the ellipse.
UnitVector3d getF2() const
getF2 returns the second focal point of the ellipse.
bool isGreatCircle() const
Angle getBeta() const
getBeta returns β, the second semi-axis length of the ellipse.
Relationship relate(Region const &r) const override
Circle getBoundingCircle() const override
getBoundingCircle returns a bounding-circle for this region.
Box getBoundingBox() const override
getBoundingBox returns a bounding-box for this region.
Ellipse(Circle const &c)
This constructor creates an ellipse corresponding to the given circle.
std::vector< uint8_t > encode() const override
encode serializes this region into an opaque byte string.
Ellipse(UnitVector3d const &v, Angle alpha=Angle(0.0))
This constructor creates an ellipse corresponding to the circle with the given center and opening ang...
Ellipse()
This constructor creates an empty ellipse.
bool operator==(Ellipse const &e) const
UnitVector3d getF1() const
getF1 returns the first focal point of the ellipse.
Angle getGamma() const
getGamma returns ɣ ∈ [0, π/2], half of the angle between the foci.
static std::unique_ptr< Ellipse > decode(std::vector< uint8_t > const &s)
std::unique_ptr< Region > clone() const override
clone returns a deep copy of this region.
bool operator!=(Ellipse const &e) const
Ellipse & complement()
complement sets this ellipse to the closure of its complement.
Matrix3d const & getTransformMatrix() const
getTransformMatrix returns the orthogonal matrix that maps vectors to the basis in which the quadrati...
Ellipse complemented() const
complemented returns the closure of the complement of this ellipse.
bool contains(UnitVector3d const &v) const override
contains tests whether the given unit vector is inside this region.
UnitVector3d getCenter() const
getCenter returns the center of the ellipse as a unit vector.
Box3d getBoundingBox3d() const override
getBoundingBox3d returns a 3-dimensional bounding-box for this region.
A 3x3 matrix with real entries stored in double precision.
Region is a minimal interface for 2-dimensional regions on the unit sphere.
virtual Relationship relate(Region const &) const =0
virtual bool contains(UnitVector3d const &) const =0
contains tests whether the given unit vector is inside this region.
UnitVector3d is a unit vector in ℝ³ with components stored in double precision.
static UnitVector3d fromNormalized(Vector3d const &v)
fromNormalized returns the unit vector equal to v, which is assumed to be normalized.
UnitVector3d rotatedAround(UnitVector3d const &k, Angle a) const
rotatedAround returns a copy of this unit vector, rotated around the unit vector k by angle a accordi...
std::ostream & operator<<(std::ostream &, Angle const &)
int orientation(UnitVector3d const &a, UnitVector3d const &b, UnitVector3d const &c)
orientation computes and returns the orientations of 3 unit vectors a, b and c.
Relationship invert(Relationship r)
Given the relationship between two sets A and B (i.e.