Vector4 Class Reference

double Generic x, y, z, w vector More...

#include <math/gzmath.hh>

Public Member Functions

 Vector4 ()
 Constructor. More...
 
 Vector4 (const double &_x, const double &_y, const double &_z, const double &_w)
 Constructor with component values. More...
 
 Vector4 (const Vector4 &_v)
 Copy constructor. More...
 
virtual ~Vector4 ()
 Destructor. More...
 
double Distance (const Vector4 &_pt) const
 Calc distance to the given point. More...
 
double GetLength () const
 Returns the length (magnitude) of the vector. More...
 
double GetSquaredLength () const
 Return the square of the length (magnitude) of the vector. More...
 
bool IsFinite () const
 See if a point is finite (e.g., not nan) More...
 
void Normalize ()
 Normalize the vector length. More...
 
bool operator!= (const Vector4 &_pt) const
 Not equal to operator. More...
 
const Vector4 operator* (const Vector4 &_pt) const
 Multiplication operator. More...
 
const Vector4 operator* (const Matrix4 &_m) const
 Matrix multiplication operator. More...
 
const Vector4 operator* (double _v) const
 Multiplication operators. More...
 
const Vector4operator*= (const Vector4 &_pt)
 Multiplication assignment operator. More...
 
const Vector4operator*= (double _v)
 Multiplication assignment operator. More...
 
Vector4 operator+ (const Vector4 &_v) const
 Addition operator. More...
 
const Vector4operator+= (const Vector4 &_v)
 Addition operator. More...
 
Vector4 operator- (const Vector4 &_v) const
 Subtraction operator. More...
 
const Vector4operator-= (const Vector4 &_v)
 Subtraction assigment operators. More...
 
const Vector4 operator/ (const Vector4 &_v) const
 Division assignment operator. More...
 
const Vector4 operator/ (double _v) const
 Division assignment operator. More...
 
const Vector4operator/= (const Vector4 &_v)
 Division assignment operator. More...
 
const Vector4operator/= (double _v)
 Division operator. More...
 
Vector4operator= (const Vector4 &_v)
 Assignment operator. More...
 
Vector4operator= (double _value)
 Assignment operator. More...
 
bool operator== (const Vector4 &_pt) const
 Equal to operator. More...
 
double operator[] (unsigned int _index) const
 Array subscript operator. More...
 
void Set (double _x=0, double _y=0, double _z=0, double _w=0)
 Set the contents of the vector. More...
 

Public Attributes

double w
 W value. More...
 
double x
 X value. More...
 
double y
 Y value. More...
 
double z
 Z value. More...
 

Friends

std::ostream & operator<< (std::ostream &_out, const gazebo::math::Vector4 &_pt)
 Stream insertion operator. More...
 
std::istream & operator>> (std::istream &_in, gazebo::math::Vector4 &_pt)
 Stream extraction operator. More...
 

Detailed Description

double Generic x, y, z, w vector

Constructor & Destructor Documentation

§ Vector4() [1/3]

Vector4 ( )

Constructor.

§ Vector4() [2/3]

Vector4 ( const double &  _x,
const double &  _y,
const double &  _z,
const double &  _w 
)

Constructor with component values.

Parameters
[in]_xvalue along x axis
[in]_yvalue along y axis
[in]_zvalue along z axis
[in]_wvalue along w axis

§ Vector4() [3/3]

Vector4 ( const Vector4 _v)

Copy constructor.

Parameters
[in]_vvector

§ ~Vector4()

virtual ~Vector4 ( )
virtual

Destructor.

Member Function Documentation

§ Distance()

double Distance ( const Vector4 _pt) const

Calc distance to the given point.

Parameters
[in]_ptthe point
Returns
the distance

§ GetLength()

double GetLength ( ) const

Returns the length (magnitude) of the vector.

§ GetSquaredLength()

double GetSquaredLength ( ) const

Return the square of the length (magnitude) of the vector.

Returns
the length

§ IsFinite()

bool IsFinite ( ) const

See if a point is finite (e.g., not nan)

Returns
true if finite, false otherwise

§ Normalize()

void Normalize ( )

Normalize the vector length.

§ operator!=()

bool operator!= ( const Vector4 _pt) const

Not equal to operator.

Parameters
[in]_ptthe other vector
Returns
true if each component is equal withing a default tolerence (1e-6), false otherwise

§ operator*() [1/3]

const Vector4 operator* ( const Vector4 _pt) const

Multiplication operator.

Remarks
Performs element wise multiplication, which has limited use.
Parameters
[in]_ptanother vector
Returns
result vector

§ operator*() [2/3]

const Vector4 operator* ( const Matrix4 _m) const

Matrix multiplication operator.

Parameters
[in]_mmatrix
Returns
the vector multiplied by _m

§ operator*() [3/3]

const Vector4 operator* ( double  _v) const

Multiplication operators.

Parameters
[in]_vscaling factor
Returns
a scaled vector

§ operator*=() [1/2]

const Vector4& operator*= ( const Vector4 _pt)

Multiplication assignment operator.

Remarks
Performs element wise multiplication, which has limited use.
Parameters
[in]_pta vector
Returns
this

§ operator*=() [2/2]

const Vector4& operator*= ( double  _v)

Multiplication assignment operator.

Parameters
[in]_vscaling factor
Returns
this

§ operator+()

Vector4 operator+ ( const Vector4 _v) const

Addition operator.

Parameters
[in]_vthe vector to add
Returns
a sum vector

§ operator+=()

const Vector4& operator+= ( const Vector4 _v)

Addition operator.

Parameters
[in]_vthe vector to add
Returns
this vector

§ operator-()

Vector4 operator- ( const Vector4 _v) const

Subtraction operator.

Parameters
[in]_vthe vector to substract
Returns
a vector

§ operator-=()

const Vector4& operator-= ( const Vector4 _v)

Subtraction assigment operators.

Parameters
[in]_vthe vector to substract
Returns
this vector

§ operator/() [1/2]

const Vector4 operator/ ( const Vector4 _v) const

Division assignment operator.

Remarks
Performs element wise division, which has limited use.
Parameters
[in]_vthe vector to perform element wise division with
Returns
a result vector

§ operator/() [2/2]

const Vector4 operator/ ( double  _v) const

Division assignment operator.

Remarks
Performs element wise division, which has limited use.
Parameters
[in]_ptanother vector
Returns
a result vector

§ operator/=() [1/2]

const Vector4& operator/= ( const Vector4 _v)

Division assignment operator.

Remarks
Performs element wise division, which has limited use.
Parameters
[in]_vthe vector to perform element wise division with
Returns
this

§ operator/=() [2/2]

const Vector4& operator/= ( double  _v)

Division operator.

Parameters
[in]_vscaling factor
Returns
a vector

§ operator=() [1/2]

Vector4& operator= ( const Vector4 _v)

Assignment operator.

Parameters
[in]_vthe vector
Returns
a reference to this vector

§ operator=() [2/2]

Vector4& operator= ( double  _value)

Assignment operator.

Parameters
[in]_value

§ operator==()

bool operator== ( const Vector4 _pt) const

Equal to operator.

Parameters
[in]_ptthe other vector
Returns
true if each component is equal withing a default tolerence (1e-6), false otherwise

§ operator[]()

double operator[] ( unsigned int  _index) const

Array subscript operator.

Parameters
[in]_index

§ Set()

void Set ( double  _x = 0,
double  _y = 0,
double  _z = 0,
double  _w = 0 
)

Set the contents of the vector.

Parameters
[in]_xvalue along x axis
[in]_yvalue along y axis
[in]_zvalue along z axis
[in]_wvalue along w axis

Friends And Related Function Documentation

§ operator<<

std::ostream& operator<< ( std::ostream &  _out,
const gazebo::math::Vector4 _pt 
)
friend

Stream insertion operator.

Parameters
[in]_outoutput stream
[in]_ptVector4 to output
Returns
The stream

§ operator>>

std::istream& operator>> ( std::istream &  _in,
gazebo::math::Vector4 _pt 
)
friend

Stream extraction operator.

Parameters
[in]_ininput stream
[in]_ptVector4 to read values into
Returns
the stream

Member Data Documentation

§ w

double w

W value.

Referenced by BulletTypes::ConvertVector4().

§ x

double x

X value.

Referenced by BulletTypes::ConvertVector4().

§ y

double y

Y value.

Referenced by BulletTypes::ConvertVector4().

§ z

double z

Z value.

Referenced by BulletTypes::ConvertVector4().


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