Loading...
Searching...
No Matches
jrlMathTools::Vector3D< T > Struct Template Reference

Generic 3d vector. More...

#include <jrl/mathtools/vector3.hh>

Public Member Functions

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

◆ normalize()

◆ 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]

◆ 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