3D Vector Class More...
#include <SGVec3.hxx>
Public Member Functions | |
SGVec3 (void) | |
Default constructor. | |
SGVec3 (T x, T y, T z) | |
Constructor. Initialize by the given values. | |
SGVec3 (const T *d) | |
Constructor. | |
const T & | operator() (unsigned i) const |
Access by index, the index is unchecked. | |
T & | operator() (unsigned i) |
Access by index, the index is unchecked. | |
const T & | operator[] (unsigned i) const |
Access raw data by index, the index is unchecked. | |
T & | operator[] (unsigned i) |
Access raw data by index, the index is unchecked. | |
const T & | x (void) const |
Access the x component. | |
T & | x (void) |
Access the x component. | |
const T & | y (void) const |
Access the y component. | |
T & | y (void) |
Access the y component. | |
const T & | z (void) const |
Access the z component. | |
T & | z (void) |
Access the z component. | |
const T(& | data (void) const)[3] |
Readonly raw storage interface. | |
T(& | data (void))[3] |
Readonly raw storage interface. | |
SGVec3 & | operator+= (const SGVec3 &v) |
Inplace addition. | |
SGVec3 & | operator-= (const SGVec3 &v) |
Inplace subtraction. | |
template<typename S > | |
SGVec3 & | operator*= (S s) |
Inplace scalar multiplication. | |
template<typename S > | |
SGVec3 & | operator/= (S s) |
Inplace scalar multiplication by 1/s. | |
Static Public Member Functions | |
static SGVec3 | zeros (void) |
Return an all zero vector. | |
static SGVec3 | e1 (void) |
Return unit vectors. | |
static SGVec3 | fromGeod (const SGGeod &geod) |
Constructor. | |
static SGVec3 | fromGeoc (const SGGeoc &geoc) |
Constructor. |
3D Vector Class
Definition at line 28 of file SGVec3.hxx.
Default constructor.
Does not initialize at all. If you need them zero initialized, use SGVec3::zeros()
Initialize with nans in the debug build, that will guarantee to have a fast uninitialized default constructor in the release but shows up uninitialized values in the debug build very fast ...
Definition at line 34 of file SGVec3.hxx.
Constructor.
Initialize by the content of a plain array, make sure it has at least 3 elements
Definition at line 49 of file SGVec3.hxx.
Constructor.
Initialize by a geocentric coordinate Note that this conversion is relatively expensive to compute
Constructor.
Initialize by a geodetic coordinate Note that this conversion is relatively expensive to compute