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 ( )

Constructor.

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 ( const Vector4 _v)

Copy constructor.

Parameters
[in]_vvector
virtual ~Vector4 ( )
virtual

Destructor.

Member Function Documentation

double Distance ( const Vector4 _pt) const

Calc distance to the given point.

Parameters
[in]_ptthe point
Returns
the distance
double GetLength ( ) const

Returns the length (magnitude) of the vector.

double GetSquaredLength ( ) const

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

Returns
the length
bool IsFinite ( ) const

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

Returns
true if finite, false otherwise
void Normalize ( )

Normalize the vector length.

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
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
const Vector4 operator* ( const Matrix4 _m) const

Matrix multiplication operator.

Parameters
[in]_mmatrix
Returns
the vector multiplied by _m
const Vector4 operator* ( double  _v) const

Multiplication operators.

Parameters
[in]_vscaling factor
Returns
a scaled vector
const Vector4& operator*= ( const Vector4 _pt)

Multiplication assignment operator.

Remarks
Performs element wise multiplication, which has limited use.
Parameters
[in]_pta vector
Returns
this
const Vector4& operator*= ( double  _v)

Multiplication assignment operator.

Parameters
[in]_vscaling factor
Returns
this
Vector4 operator+ ( const Vector4 _v) const

Addition operator.

Parameters
[in]_vthe vector to add
Returns
a sum vector
const Vector4& operator+= ( const Vector4 _v)

Addition operator.

Parameters
[in]_vthe vector to add
Returns
this vector
Vector4 operator- ( const Vector4 _v) const

Subtraction operator.

Parameters
[in]_vthe vector to substract
Returns
a vector
const Vector4& operator-= ( const Vector4 _v)

Subtraction assigment operators.

Parameters
[in]_vthe vector to substract
Returns
this vector
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
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
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
const Vector4& operator/= ( double  _v)

Division operator.

Parameters
[in]_vscaling factor
Returns
a vector
Vector4& operator= ( const Vector4 _v)

Assignment operator.

Parameters
[in]_vthe vector
Returns
a reference to this vector
Vector4& operator= ( double  _value)

Assignment operator.

Parameters
[in]_value
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
double operator[] ( unsigned int  _index) const

Array subscript operator.

Parameters
[in]_index
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

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

double w

W value.

Referenced by BulletTypes::ConvertVector4().

double x

X value.

Referenced by BulletTypes::ConvertVector4().

double y

Y value.

Referenced by BulletTypes::ConvertVector4().

double z

Z value.

Referenced by BulletTypes::ConvertVector4().


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