LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
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. | |
Vector3d (double x, double y, double z) | |
This constructor creates a vector with the given components. | |
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. | |
double | operator() (int i) const |
The function call operator returns the i -th component of this vector. | |
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 . | |
double | getSquaredNorm () const |
getSquaredNorm returns the inner product of this vector with itself. | |
double | getNorm () const |
getNorm returns the L2 norm of this vector. | |
bool | isZero () const |
isZero returns true if all the components of this vector are zero. | |
double | normalize () |
normalize scales this vector to have unit norm and returns its norm prior to scaling. | |
bool | isNormalized () const |
isNormalized returns true if this vectors norm is very close to 1. | |
Vector3d | cross (Vector3d const &v) const |
cross returns the cross product of this vector and v . | |
Vector3d | operator- () const |
The unary minus operator negates every component of this vector. | |
Vector3d | operator* (double s) const |
The multiplication operator returns the component-wise product of this vector with scalar s . | |
Vector3d | operator/ (double s) const |
The division operator returns the component-wise quotient of this vector with scalar s . | |
Vector3d | operator+ (Vector3d const &v) const |
The addition operator returns the sum of this vector and v . | |
Vector3d | operator- (Vector3d const &v) const |
The subtraction operator returns the difference between this vector and v . | |
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 . | |
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. | |
Vector3d
is a vector in ℝ³ with components stored in double precision.
Definition at line 51 of file Vector3d.h.
|
inline |
The default constructor creates a zero vector.
Definition at line 54 of file Vector3d.h.
|
inline |
This constructor creates a vector with the given components.
Definition at line 57 of file Vector3d.h.
cross
returns the cross product of this vector and v
.
Definition at line 108 of file Vector3d.h.
cwiseProduct
returns the component-wise product of this vector and v
.
Definition at line 157 of file Vector3d.h.
|
inline |
dot
returns the inner product of this vector and v
.
Definition at line 80 of file Vector3d.h.
|
inline |
data
returns a pointer to the 3 components of this vector.
Definition at line 68 of file Vector3d.h.
|
inline |
getNorm
returns the L2 norm of this vector.
Definition at line 88 of file Vector3d.h.
|
inline |
getSquaredNorm
returns the inner product of this vector with itself.
Definition at line 85 of file Vector3d.h.
|
inline |
isNormalized
returns true if this vectors norm is very close to 1.
Definition at line 103 of file Vector3d.h.
|
inline |
isZero
returns true if all the components of this vector are zero.
Definition at line 93 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 49 of file Vector3d.cc.
|
inline |
Definition at line 63 of file Vector3d.h.
|
inline |
The function call operator returns the i
-th component of this vector.
Definition at line 71 of file Vector3d.h.
|
inline |
The multiplication operator returns the component-wise product of this vector with scalar s
.
Definition at line 123 of file Vector3d.h.
|
inline |
Definition at line 151 of file Vector3d.h.
The addition operator returns the sum of this vector and v
.
Definition at line 138 of file Vector3d.h.
Definition at line 153 of file Vector3d.h.
|
inline |
The unary minus operator negates every component of this vector.
Definition at line 115 of file Vector3d.h.
The subtraction operator returns the difference between this vector and v
.
Definition at line 145 of file Vector3d.h.
Definition at line 154 of file Vector3d.h.
|
inline |
The division operator returns the component-wise quotient of this vector with scalar s
.
Definition at line 131 of file Vector3d.h.
|
inline |
Definition at line 152 of file Vector3d.h.
|
inline |
Definition at line 59 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 133 of file Vector3d.cc.
|
inline |
Definition at line 73 of file Vector3d.h.
|
inline |
Definition at line 75 of file Vector3d.h.
|
inline |
Definition at line 77 of file Vector3d.h.