LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
Vector3d
is a vector in ℝ³ with components stored in double precision.
More...
#include <Vector3d.h>
Public Member Functions | |
Vector3d () | |
The default constructor creates a zero vector. More... | |
Vector3d (double x, double y, double z) | |
This constructor creates a vector with the given components. More... | |
bool | operator== (Vector3d const &v) const |
bool | operator!= (Vector3d const &v) const |
double const * | getData () const |
data returns a pointer to the 3 components of this vector. More... | |
double | operator() (int i) const |
The function call operator returns the i -th component of this vector. More... | |
double | x () const |
double | y () const |
double | z () const |
double | dot (Vector3d const &v) const |
dot returns the inner product of this vector and v . More... | |
double | getSquaredNorm () const |
getSquaredNorm returns the inner product of this vector with itself. More... | |
double | getNorm () const |
getNorm returns the L2 norm of this vector. More... | |
bool | isZero () const |
isZero returns true if all the components of this vector are zero. More... | |
double | normalize () |
normalize scales this vector to have unit norm and returns its norm prior to scaling. More... | |
bool | isNormalized () const |
isNormalized returns true if this vectors norm is very close to 1. More... | |
Vector3d | cross (Vector3d const &v) const |
cross returns the cross product of this vector and v . More... | |
Vector3d | operator- () const |
The unary minus operator negates every component of this vector. More... | |
Vector3d | operator* (double s) const |
The multiplication operator returns the component-wise product of this vector with scalar s . More... | |
Vector3d | operator/ (double s) const |
The division operator returns the component-wise quotient of this vector with scalar s . More... | |
Vector3d | operator+ (Vector3d const &v) const |
The addition operator returns the sum of this vector and v . More... | |
Vector3d | operator- (Vector3d const &v) const |
The subtraction operator returns the difference between this vector and v . More... | |
Vector3d & | operator*= (double s) |
Vector3d & | operator/= (double s) |
Vector3d & | operator+= (Vector3d const &v) |
Vector3d & | operator-= (Vector3d const &v) |
Vector3d | cwiseProduct (Vector3d const &v) const |
cwiseProduct returns the component-wise product of this vector and v . More... | |
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 the right hand rule. More... | |
Vector3d
is a vector in ℝ³ with components stored in double precision.
Definition at line 44 of file Vector3d.h.
|
inline |
The default constructor creates a zero vector.
Definition at line 47 of file Vector3d.h.
|
inline |
This constructor creates a vector with the given components.
Definition at line 50 of file Vector3d.h.
cross
returns the cross product of this vector and v
.
Definition at line 101 of file Vector3d.h.
cwiseProduct
returns the component-wise product of this vector and v
.
Definition at line 150 of file Vector3d.h.
|
inline |
dot
returns the inner product of this vector and v
.
Definition at line 73 of file Vector3d.h.
|
inline |
data
returns a pointer to the 3 components of this vector.
Definition at line 61 of file Vector3d.h.
|
inline |
getNorm
returns the L2 norm of this vector.
Definition at line 81 of file Vector3d.h.
|
inline |
getSquaredNorm
returns the inner product of this vector with itself.
Definition at line 78 of file Vector3d.h.
|
inline |
isNormalized
returns true if this vectors norm is very close to 1.
Definition at line 96 of file Vector3d.h.
|
inline |
isZero
returns true if all the components of this vector are zero.
Definition at line 86 of file Vector3d.h.
double lsst::sphgeom::Vector3d::normalize | ( | ) |
normalize
scales this vector to have unit norm and returns its norm prior to scaling.
It will accurately normalize any vector with finite components except for (0, 0, 0), including those with norms that overflow. Trying to normalize (0, 0, 0) will cause a std::runtime_error to be thrown.
Definition at line 41 of file Vector3d.cc.
|
inline |
Definition at line 56 of file Vector3d.h.
|
inline |
The function call operator returns the i
-th component of this vector.
Definition at line 64 of file Vector3d.h.
|
inline |
The multiplication operator returns the component-wise product of this vector with scalar s
.
Definition at line 116 of file Vector3d.h.
|
inline |
Definition at line 144 of file Vector3d.h.
The addition operator returns the sum of this vector and v
.
Definition at line 131 of file Vector3d.h.
Definition at line 146 of file Vector3d.h.
|
inline |
The unary minus operator negates every component of this vector.
Definition at line 108 of file Vector3d.h.
The subtraction operator returns the difference between this vector and v
.
Definition at line 138 of file Vector3d.h.
Definition at line 147 of file Vector3d.h.
|
inline |
The division operator returns the component-wise quotient of this vector with scalar s
.
Definition at line 124 of file Vector3d.h.
|
inline |
Definition at line 145 of file Vector3d.h.
|
inline |
Definition at line 52 of file Vector3d.h.
Vector3d lsst::sphgeom::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 the right hand rule.
Definition at line 125 of file Vector3d.cc.
|
inline |
Definition at line 66 of file Vector3d.h.
|
inline |
Definition at line 68 of file Vector3d.h.
|
inline |
Definition at line 70 of file Vector3d.h.