SGVec3< T > Class Template Reference

3D Vector Class More...

#include <SGVec3.hxx>

List of all members.

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.
SGVec3operator+= (const SGVec3 &v)
 Inplace addition.
SGVec3operator-= (const SGVec3 &v)
 Inplace subtraction.
template<typename S >
SGVec3operator*= (S s)
 Inplace scalar multiplication.
template<typename S >
SGVec3operator/= (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.

Detailed Description

template<typename T>
class SGVec3< T >

3D Vector Class

Definition at line 28 of file SGVec3.hxx.


Constructor & Destructor Documentation

template<typename T>
SGVec3< T >::SGVec3 ( void   )  [inline]

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.

template<typename T>
SGVec3< T >::SGVec3 ( const T *  d  )  [inline, explicit]

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.


Member Function Documentation

template<typename T>
static SGVec3 SGVec3< T >::fromGeoc ( const SGGeoc geoc  )  [static]

Constructor.

Initialize by a geocentric coordinate Note that this conversion is relatively expensive to compute

template<typename T>
static SGVec3 SGVec3< T >::fromGeod ( const SGGeod geod  )  [static]

Constructor.

Initialize by a geodetic coordinate Note that this conversion is relatively expensive to compute


The documentation for this class was generated from the following file:

Generated on 23 Feb 2010 for SimGear by  doxygen 1.6.1