LSST Applications g063fba187b+fee0456c91,g0f08755f38+ea96e5a5a3,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+90257ff92a,g20f6ffc8e0+ea96e5a5a3,g217e2c1bcf+937a289c59,g28da252d5a+daa7da44eb,g2bbee38e9b+253935c60e,g2bc492864f+253935c60e,g3156d2b45e+6e55a43351,g32e5bea42b+31359a2a7a,g347aa1857d+253935c60e,g35bb328faa+a8ce1bb630,g3a166c0a6a+253935c60e,g3b1af351f3+a8ce1bb630,g3e281a1b8c+c5dd892a6c,g414038480c+416496e02f,g41af890bb2+afe91b1188,g599934f4f4+0db33f7991,g7af13505b9+e36de7bce6,g80478fca09+da231ba887,g82479be7b0+a4516e59e3,g858d7b2824+ea96e5a5a3,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+bc6ab8dfbd,gb58c049af0+d64f4d3760,gc28159a63d+253935c60e,gcab2d0539d+3f2b72788c,gcf0d15dbbd+4ea9c45075,gda6a2b7d83+4ea9c45075,gdaeeff99f8+1711a396fd,ge79ae78c31+253935c60e,gef2f8181fd+3031e3cf99,gf0baf85859+c1f95f4921,gfa517265be+ea96e5a5a3,gfa999e8aa5+17cd334064,w.2024.50
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.