23 #ifndef LSST_SPHGEOM_UNITVECTOR3D_H_
24 #define LSST_SPHGEOM_UNITVECTOR3D_H_
145 double x()
const {
return _v.
x(); }
147 double y()
const {
return _v.
y(); }
149 double z()
const {
return _v.
z(); }
162 return (v + *
this).
cross(v - *
this);
This file contains a class representing spherical coordinates.
This file declares a class for representing vectors in ℝ³.
Angle represents an angle in radians.
LonLat represents a spherical coordinate (longitude/latitude angle) pair.
NormalizedAngle getLon() const
NormalizedAngle is an angle that lies in the range [0, 2π), with one exception - a NormalizedAngle ca...
UnitVector3d is a unit vector in ℝ³ with components stored in double precision.
double dot(Vector3d const &v) const
dot returns the inner product of this unit vector and v.
UnitVector3d operator-() const
The unary minus operator negates every component of this unit vector.
Vector3d robustCross(UnitVector3d const &v) const
a.robustCross(b) is (b + a).cross(b - a) - twice the cross product of a and b.
Vector3d cwiseProduct(Vector3d const &v) const
cwiseProduct returns the component-wise product of this unit vector and v.
Vector3d operator+(Vector3d const &v) const
The addition operator returns the sum of this unit vector and v.
static UnitVector3d fromNormalized(double x, double y, double z)
fromNormalized returns the unit vector with the given components, which are assumed to correspond to ...
UnitVector3d(double x, double y, double z)
static UnitVector3d orthogonalTo(NormalizedAngle const &a)
orthogonalTo returns the unit vector orthogonal to the meridian with the given longitude.
UnitVector3d(Vector3d const &v)
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...
Vector3d operator*(double s) const
The multiplication operator returns the component-wise product of this unit vector with scalar s.
Vector3d operator/(double s) const
The division operator returns the component-wise quotient of this unit vector with scalar s.
UnitVector3d()
The default constructor creates a unit vector equal to (1, 0, 0).
bool operator==(Vector3d const &v) const
double const * getData() const
getData returns a pointer to the 3 components of this unit vector.
Vector3d operator-(Vector3d const &v) const
The subtraction operator returns the difference between this unit vector and v.
static UnitVector3d orthogonalTo(Vector3d const &v)
orthogonalTo returns an arbitrary unit vector that is orthogonal to v.
Vector3d cross(Vector3d const &v) const
cross returns the cross product of this unit vector and v.
UnitVector3d(UnitVector3d const &v)=default
UnitVector3d(LonLat const &p)
This constructor creates the unit vector corresponding to the point p on the unit sphere.
bool operator!=(Vector3d const &v) const
double operator()(int i) const
The function call operator returns the i-th component of this vector.
static UnitVector3d northFrom(Vector3d const &v)
northFrom returns the unit vector orthogonal to v that points "north" from v.
Vector3d is a vector in ℝ³ with components stored in double precision.
Vector3d cwiseProduct(Vector3d const &v) const
cwiseProduct returns the component-wise product of this vector and v.
Vector3d rotatedAround(UnitVector3d const &k, Angle a) const
rotatedAround returns a copy of this vector, rotated around the unit vector k by angle a according to...
double dot(Vector3d const &v) const
dot returns the inner product of this vector and v.
double normalize()
normalize scales this vector to have unit norm and returns its norm prior to scaling.
double const * getData() const
data returns a pointer to the 3 components of this vector.
Vector3d cross(Vector3d const &v) const
cross returns the cross product of this vector and v.
std::ostream & operator<<(std::ostream &, Angle const &)
double sin(Angle const &a)
double cos(Angle const &a)
A base class for image defects.