jrlMathTools::Vector3D< T > Struct Template Reference

Generic 3d vector. More...

#include <jrl/mathtools/vector3.hh>

Collaboration diagram for jrlMathTools::Vector3D< T >:

Public Member Functions

 Vector3D ()
 Default constructor: all fields are set to zero. More...
 
 Vector3D (const T x, const T y, const T z)
 
Vector3D< T > & operator= (const Vector3D< T > &v)
 Assignment operator. More...
 
Vector3D< T > operator- () const
 Unary operator -. More...
 
T & operator[] (unsigned i)
 Array operator. More...
 
operator[] (unsigned i) const
 Array operator. More...
 
T & operator() (unsigned i)
 Array operator. More...
 
operator() (unsigned i) const
 Array operator. More...
 
bool operator== (const Vector3D< T > &v) const
 Binary operator ==. More...
 
bool operator!= (const Vector3D< T > &v) const
 Binary operator !=. More...
 
Vector3D< T > operator+ (const Vector3D< T > &v) const
 Binary operator +. More...
 
Vector3D< T > operator- (const Vector3D< T > &v) const
 Binary operator -. More...
 
void operator+= (const Vector3D< T > &v)
 Binary operator +=. More...
 
void operator-= (const Vector3D< T > &v)
 Binary operator -=. More...
 
Vector3D< T > operator* (const T &t) const
 Binary operator *. More...
 
operator* (const Vector3D< T > &v) const
 Binary operator * : dot product. More...
 
Vector3D< T > operator/ (const T &t) const
 Binary operator /. More...
 
void operator*= (const T &t)
 Binary operator *=. More...
 
void operator/= (const T &t)
 Binary operator /=. More...
 
void normalize ()
 Normalize . More...
 
norm () const
 Get the norm. More...
 
bool IsZero () const
 Check if the vector is set to zero. More...
 
normsquared () const
 Get the norm squared. More...
 
Vector3D< T > operator^ (const Vector3D< T > &v2) const
 Cross product. More...
 
std::ostream & display (std::ostream &os) const
 

Public Attributes

m_x
 
m_y
 
m_z
 

Detailed Description

template<typename T>
struct jrlMathTools::Vector3D< T >

Generic 3d vector.

Constructor & Destructor Documentation

◆ Vector3D() [1/2]

template<typename T>
jrlMathTools::Vector3D< T >::Vector3D ( )
inline

Default constructor: all fields are set to zero.

◆ Vector3D() [2/2]

template<typename T>
jrlMathTools::Vector3D< T >::Vector3D ( const T  x,
const T  y,
const T  z 
)
inline

Member Function Documentation

◆ display()

template<typename T>
std::ostream& jrlMathTools::Vector3D< T >::display ( std::ostream &  os) const
inline

◆ IsZero()

template<typename T>
bool jrlMathTools::Vector3D< T >::IsZero ( ) const
inline

◆ norm()

template<typename T>
T jrlMathTools::Vector3D< T >::norm ( ) const
inline

◆ normalize()

template<typename T>
void jrlMathTools::Vector3D< T >::normalize ( )
inline

◆ normsquared()

template<typename T>
T jrlMathTools::Vector3D< T >::normsquared ( ) const
inline

◆ operator!=()

template<typename T>
bool jrlMathTools::Vector3D< T >::operator!= ( const Vector3D< T > &  v) const
inline

◆ operator()() [1/2]

template<typename T>
T& jrlMathTools::Vector3D< T >::operator() ( unsigned  i)
inline

Array operator.

◆ operator()() [2/2]

template<typename T>
T jrlMathTools::Vector3D< T >::operator() ( unsigned  i) const
inline

Array operator.

◆ operator*() [1/2]

template<typename T>
Vector3D<T> jrlMathTools::Vector3D< T >::operator* ( const T &  t) const
inline

◆ operator*() [2/2]

template<typename T>
T jrlMathTools::Vector3D< T >::operator* ( const Vector3D< T > &  v) const
inline

◆ operator*=()

template<typename T>
void jrlMathTools::Vector3D< T >::operator*= ( const T &  t)
inline

◆ operator+()

template<typename T>
Vector3D<T> jrlMathTools::Vector3D< T >::operator+ ( const Vector3D< T > &  v) const
inline

◆ operator+=()

template<typename T>
void jrlMathTools::Vector3D< T >::operator+= ( const Vector3D< T > &  v)
inline

◆ operator-() [1/2]

template<typename T>
Vector3D<T> jrlMathTools::Vector3D< T >::operator- ( ) const
inline

◆ operator-() [2/2]

template<typename T>
Vector3D<T> jrlMathTools::Vector3D< T >::operator- ( const Vector3D< T > &  v) const
inline

◆ operator-=()

template<typename T>
void jrlMathTools::Vector3D< T >::operator-= ( const Vector3D< T > &  v)
inline

◆ operator/()

template<typename T>
Vector3D<T> jrlMathTools::Vector3D< T >::operator/ ( const T &  t) const
inline

◆ operator/=()

template<typename T>
void jrlMathTools::Vector3D< T >::operator/= ( const T &  t)
inline

◆ operator=()

template<typename T>
Vector3D<T>& jrlMathTools::Vector3D< T >::operator= ( const Vector3D< T > &  v)
inline

◆ operator==()

template<typename T>
bool jrlMathTools::Vector3D< T >::operator== ( const Vector3D< T > &  v) const
inline

◆ operator[]() [1/2]

template<typename T>
T& jrlMathTools::Vector3D< T >::operator[] ( unsigned  i)
inline

◆ operator[]() [2/2]

template<typename T>
T jrlMathTools::Vector3D< T >::operator[] ( unsigned  i) const
inline

◆ operator^()

template<typename T>
Vector3D<T> jrlMathTools::Vector3D< T >::operator^ ( const Vector3D< T > &  v2) const
inline

Member Data Documentation

◆ m_x

◆ m_y

◆ m_z