libalmath  2.5.7.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
AL::Math::Velocity6D Struct Reference

Create and play with a Velocity6D. More...

#include <alvelocity6d.h>

Public Member Functions

 Velocity6D ()
 Create a Velocity6D initialize with 0.0f. More...
 
 Velocity6D (float pInit)
 Create a Velocity6D initialize with the same float. More...
 
 Velocity6D (float pXd, float pYd, float pZd, float pWxd, float pWyd, float pWzd)
 Create a Velocity6D initialize with explicit value. More...
 
 Velocity6D (const std::vector< float > &pFloats)
 Create a Velocity6D with an std::vector. More...
 
Velocity6D operator+ (const Velocity6D &pVel2) const
 Overloading of operator + for Velocity6D. More...
 
Velocity6D operator- (const Velocity6D &pVel2) const
 Overloading of operator - for Velocity6D. More...
 
Velocity6D operator+ (void) const
 Overloading of operator + for Velocity6D. More...
 
Velocity6D operator- () const
 Overloading of operator - for Velocity6D. More...
 
Velocity6D operator* (const float pVal) const
 Overloading of operator * for Velocity6D. More...
 
Velocity6D operator/ (const float pVal) const
 Overloading of operator / for Velocity6D. More...
 
bool operator== (const Velocity6D &pVel2) const
 Overloading of operator == for Velocity6D. More...
 
bool operator!= (const Velocity6D &pVel2) const
 Overloading of operator != for Velocity6D. More...
 
Velocity6Doperator*= (const float pVal)
 Overloading of operator *= for Velocity6D. More...
 
Velocity6Doperator/= (const float pVal)
 Overloading of operator /= for Velocity6D. More...
 
bool isNear (const Velocity6D &pVel2, const float &pEpsilon=0.0001f) const
 Check if the actual Velocity6D is Near the one given in argument. More...
 
float norm () const
 Compute the norm of the actual Velocity6D: More...
 
Velocity6D normalize () const
 Normalize the actual Velocity6D: More...
 
void toVector (std::vector< float > &pReturnVector) const
 Return the Velocity6D as a vector of float [xd, yd, zd, wxd, wyd, wzd]. More...
 
std::vector< float > toVector (void) const
 
void writeToVector (std::vector< float >::iterator &pIt) const
 Write [xd, yd, zd, wxd, wyd, wzd] in the vector and update the iterator. It is assumed the vector has enough space. More...
 

Public Attributes

float xd
 
float yd
 
float zd
 
float wxd
 
float wyd
 
float wzd
 

Detailed Description

Create and play with a Velocity6D.

A Velocity6D is just defined by xd, yd, zd, wxd, wyd and wzd.

Definition at line 24 of file alvelocity6d.h.

Constructor & Destructor Documentation

AL::Math::Velocity6D::Velocity6D ( )

Create a Velocity6D initialize with 0.0f.

$ \left[\begin{array}{c} xd \\ yd \\ zd \\ wxd \\ wyd \\ wzd \end{array}\right] = \left[\begin{array}{c} 0.0 \\ 0.0 \\ 0.0 \\ 0.0 \\ 0.0 \\ 0.0 \end{array}\right]$

AL::Math::Velocity6D::Velocity6D ( float  pInit)
explicit

Create a Velocity6D initialize with the same float.

$ \left[\begin{array}{c} xd \\ yd \\ zd \\ wxd \\ wyd \\ wzd \end{array}\right] = \left[\begin{array}{c} pInit \\ pInit \\ pInit \\ pInit \\ pInit \\ pInit \end{array}\right]$

Parameters
pInitthe float value for each member
AL::Math::Velocity6D::Velocity6D ( float  pXd,
float  pYd,
float  pZd,
float  pWxd,
float  pWyd,
float  pWzd 
)

Create a Velocity6D initialize with explicit value.

$ \left[\begin{array}{c} xd \\ yd \\ zd \\ wxd \\ wyd \\ wzd \end{array}\right] = \left[\begin{array}{c} pXd \\ pYd \\ pZd \\ pWxd \\ pWyd \\ pWzd \end{array}\right]$

Parameters
pXdthe float value for xd
pYdthe float value for yd
pZdthe float value for zd
pWxdthe float value for wxd
pWydthe float value for wyd
pWzdthe float value for wzd
AL::Math::Velocity6D::Velocity6D ( const std::vector< float > &  pFloats)

Create a Velocity6D with an std::vector.

$ \left[\begin{array}{c} xd \\ yd \\ zd \\ wxd \\ wyd \\ wzd \end{array}\right] = \left[\begin{array}{c} pFloats[0] \\ pFloats[1] \\ pFloats[2] \\ pFloats[3] \\ pFloats[4] \\ pFloats[5] \end{array}\right]$

Parameters
pFloatsAn std::vector<float> of size 6 for respectively:

xd, yd, zd, wxd, wyd and wzd

Member Function Documentation

bool AL::Math::Velocity6D::isNear ( const Velocity6D pVel2,
const float &  pEpsilon = 0.0001f 
) const

Check if the actual Velocity6D is Near the one given in argument.

Parameters
pVel2the second Velocity6D
pEpsilonan optional epsilon distance
Returns
true if the difference of each float of the two Velocity6D is less than pEpsilon
float AL::Math::Velocity6D::norm ( ) const

Compute the norm of the actual Velocity6D:

$\sqrt{xd^2 + yd^2 + zd^2 + wxd^2 + wyd^2 + wzd^2}$

Returns
the float norm of the Velocity6D
Velocity6D AL::Math::Velocity6D::normalize ( ) const

Normalize the actual Velocity6D:

$ result = \frac{pVel}{norm(pVel)} $

Returns
the Velocity6D normalized
bool AL::Math::Velocity6D::operator!= ( const Velocity6D pVel2) const

Overloading of operator != for Velocity6D.

Parameters
pVel2the second Velocity6D.
Velocity6D AL::Math::Velocity6D::operator* ( const float  pVal) const
inline

Overloading of operator * for Velocity6D.

Parameters
pValthe float factor.

Definition at line 203 of file alvelocity6d.h.

Velocity6D& AL::Math::Velocity6D::operator*= ( const float  pVal)

Overloading of operator *= for Velocity6D.

Parameters
pValthe float factor.
Velocity6D AL::Math::Velocity6D::operator+ ( const Velocity6D pVel2) const
inline

Overloading of operator + for Velocity6D.

Parameters
pVel2the second Velocity6D

Definition at line 157 of file alvelocity6d.h.

Velocity6D AL::Math::Velocity6D::operator+ ( void  ) const
inline

Overloading of operator + for Velocity6D.

Definition at line 186 of file alvelocity6d.h.

Velocity6D AL::Math::Velocity6D::operator- ( const Velocity6D pVel2) const
inline

Overloading of operator - for Velocity6D.

Parameters
pVel2the second Velocity6D

Definition at line 172 of file alvelocity6d.h.

Velocity6D AL::Math::Velocity6D::operator- ( ) const
inline

Overloading of operator - for Velocity6D.

Definition at line 194 of file alvelocity6d.h.

Velocity6D AL::Math::Velocity6D::operator/ ( const float  pVal) const

Overloading of operator / for Velocity6D.

Parameters
pValthe float factor.
Velocity6D& AL::Math::Velocity6D::operator/= ( const float  pVal)

Overloading of operator /= for Velocity6D.

Parameters
pValthe float factor.
bool AL::Math::Velocity6D::operator== ( const Velocity6D pVel2) const

Overloading of operator == for Velocity6D.

Parameters
pVel2the second Velocity6D.
void AL::Math::Velocity6D::toVector ( std::vector< float > &  pReturnVector) const

Return the Velocity6D as a vector of float [xd, yd, zd, wxd, wyd, wzd].

std::vector<float> AL::Math::Velocity6D::toVector ( void  ) const
void AL::Math::Velocity6D::writeToVector ( std::vector< float >::iterator &  pIt) const

Write [xd, yd, zd, wxd, wyd, wzd] in the vector and update the iterator. It is assumed the vector has enough space.

Member Data Documentation

float AL::Math::Velocity6D::wxd

Definition at line 32 of file alvelocity6d.h.

float AL::Math::Velocity6D::wyd

Definition at line 34 of file alvelocity6d.h.

float AL::Math::Velocity6D::wzd

Definition at line 36 of file alvelocity6d.h.

float AL::Math::Velocity6D::xd

Definition at line 26 of file alvelocity6d.h.

float AL::Math::Velocity6D::yd

Definition at line 28 of file alvelocity6d.h.

float AL::Math::Velocity6D::zd

Definition at line 30 of file alvelocity6d.h.


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