libalmath  1.14
 All Classes Namespaces Functions Variables Typedefs Groups Pages
Public Member Functions | Public Attributes
AL::Math::Position6D Struct Reference

Create and play with a Position6D. More...

#include <alposition6d.h>

List of all members.

Public Member Functions

 Position6D ()
 Create a Position6D initialized with 0.0f.
 Position6D (float pInit)
 Create a Position6D initialized with the same float.
 Position6D (float pX, float pY, float pZ, float pWx, float pWy, float pWz)
 Create a Position6D initialized with explicit value.
 Position6D (const std::vector< float > &pFloats)
 Create a Position6D with an std::vector.
Position6D operator+ (const Position6D &pPos2) const
 Overloading of operator + for Position6D.
Position6D operator- (const Position6D &pPos2) const
 Overloading of operator - for Position6D.
Position6D operator+ () const
 Overloading of operator + for Position6D.
Position6D operator- () const
 Overloading of operator - for Position6D.
Position6Doperator+= (const Position6D &pPos2)
 Overloading of operator += for Position6D.
Position6Doperator-= (const Position6D &pPos2)
 Overloading of operator -= for Position6D.
bool operator== (const Position6D &pPos2) const
 Overloading of operator == for Position6D.
bool operator!= (const Position6D &pPos2) const
 Overloading of operator != for Position6D.
Position6D operator* (float pVal) const
 Overloading of operator * for Position6D.
Position6D operator/ (float pVal) const
 Overloading of operator / for Position6D.
Position6Doperator*= (float pVal)
 Overloading of operator *= for Position6D.
Position6Doperator/= (float pVal)
 Overloading of operator /= for Position6D.
bool isNear (const Position6D &pPos2, const float &pEpsilon=0.0001f) const
 Check if the actual Position6D is near the one given in argument.
float distanceSquared (const Position6D &pPos2) const
 Compute the squared distance of translation part (x, y and z) between the actual Position6D and the one give in argument:
float distance (const Position6D &pPos2) const
 Compute the distance of translation part (x, y and z) between the actual Position6D and the one give in argument:
float norm () const
 Compute the norm of the actual Position6D:
std::vector< float > toVector () const
 Return the Position6D as a vector of float [x, y, z, wx, wy, wz].

Public Attributes

float x
float y
float z
float wx
float wy
float wz

Detailed Description

Create and play with a Position6D.

A Position6D is just defined by x, y, z, wx, wy and wz.

Definition at line 23 of file alposition6d.h.


Constructor & Destructor Documentation

AL::Math::Position6D::Position6D ( )

Create a Position6D initialized with 0.0f.

$ \left[\begin{array}{c} x \\ y \\ z \\ wx \\ wy \\ wz \end{array}\right] = \left[\begin{array}{c} 0.0 \\ 0.0 \\ 0.0 \\ 0.0 \\ 0.0 \\ 0.0 \end{array}\right]$

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

Create a Position6D initialized with the same float.

$ \left[\begin{array}{c} x \\ y \\ z \\ wx \\ wy \\ wz \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::Position6D::Position6D ( float  pX,
float  pY,
float  pZ,
float  pWx,
float  pWy,
float  pWz 
)

Create a Position6D initialized with explicit value.

$ \left[\begin{array}{c} x \\ y \\ z \\ wx \\ wy \\ wz \end{array}\right] = \left[\begin{array}{c} pX \\ pY \\ pZ \\ pWx \\ pWy \\ pWz \end{array}\right]$

Parameters:
pXthe float value for x
pYthe float value for y
pZthe float value for z
pWxthe float value for wx
pWythe float value for wy
pWzthe float value for wz
AL::Math::Position6D::Position6D ( const std::vector< float > &  pFloats)

Create a Position6D with an std::vector.

$ \left[\begin{array}{c} x \\ y \\ z \\ wx \\ wy \\ wz \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: x, y, z, wx, wy and wz

Member Function Documentation

float AL::Math::Position6D::distance ( const Position6D pPos2) const

Compute the distance of translation part (x, y and z) between the actual Position6D and the one give in argument:

$\sqrt{(pPos1.x-pPos2.x)^2+(pPos1.y-pPos2.y)^2+(pPos1.z-pPos2.z)^2}$

Parameters:
pPos2the second Position6D
Returns:
the float distance between the two Position6D
float AL::Math::Position6D::distanceSquared ( const Position6D pPos2) const

Compute the squared distance of translation part (x, y and z) between the actual Position6D and the one give in argument:

$(pPos1.x-pPos2.x)^2+(pPos1.y-pPos2.y)^2+(pPos1.z-pPos2.z)^2$

Parameters:
pPos2the second Position6D
Returns:
the float squared distance between the two Position6D
bool AL::Math::Position6D::isNear ( const Position6D pPos2,
const float &  pEpsilon = 0.0001f 
) const

Check if the actual Position6D is near the one given in argument.

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

Compute the norm of the actual Position6D:

$\sqrt{pPos.x^2 + pPos.y^2 + pPos.z^2 + pPos.wx^2 + pPos.wy^2 + pPos.wz^2}$

Returns:
the float norm of the Position6D
bool AL::Math::Position6D::operator!= ( const Position6D pPos2) const

Overloading of operator != for Position6D.

Parameters:
pPos2the second Position6D
Position6D AL::Math::Position6D::operator* ( float  pVal) const

Overloading of operator * for Position6D.

Parameters:
pValthe float factor
Position6D& AL::Math::Position6D::operator*= ( float  pVal)

Overloading of operator *= for Position6D.

Parameters:
pValthe float factor
Position6D AL::Math::Position6D::operator+ ( const Position6D pPos2) const

Overloading of operator + for Position6D.

Parameters:
pPos2the second Position6D
Position6D AL::Math::Position6D::operator+ ( ) const

Overloading of operator + for Position6D.

Position6D& AL::Math::Position6D::operator+= ( const Position6D pPos2)

Overloading of operator += for Position6D.

Parameters:
pPos2the second Position6D
Position6D AL::Math::Position6D::operator- ( const Position6D pPos2) const

Overloading of operator - for Position6D.

Parameters:
pPos2the second Position6D
Position6D AL::Math::Position6D::operator- ( ) const

Overloading of operator - for Position6D.

Position6D& AL::Math::Position6D::operator-= ( const Position6D pPos2)

Overloading of operator -= for Position6D.

Parameters:
pPos2the second Position6D
Position6D AL::Math::Position6D::operator/ ( float  pVal) const

Overloading of operator / for Position6D.

Parameters:
pValthe float factor
Position6D& AL::Math::Position6D::operator/= ( float  pVal)

Overloading of operator /= for Position6D.

Parameters:
pValthe float factor
bool AL::Math::Position6D::operator== ( const Position6D pPos2) const

Overloading of operator == for Position6D.

Parameters:
pPos2the second Position6D
std::vector<float> AL::Math::Position6D::toVector ( ) const

Return the Position6D as a vector of float [x, y, z, wx, wy, wz].


Member Data Documentation

float AL::Math::Position6D::wx

Definition at line 31 of file alposition6d.h.

float AL::Math::Position6D::wy

Definition at line 33 of file alposition6d.h.

float AL::Math::Position6D::wz

Definition at line 35 of file alposition6d.h.

float AL::Math::Position6D::x

Definition at line 25 of file alposition6d.h.

float AL::Math::Position6D::y

Definition at line 27 of file alposition6d.h.

float AL::Math::Position6D::z

Definition at line 29 of file alposition6d.h.


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