Loading...
Searching...
No Matches
CommonMath::Vec3 Class Reference

3D vector class with common vector operations. More...

#include </home/thodoris/src/ompl/demos/multicopter/CommonMath/Vec3.h>

Public Member Functions

 Vec3 (void)
 Initialises all members to NaN.
 Vec3 (double xin, double yin, double zin)
 Initialise vector.
 Vec3 (const double in[3])
 Initialise vector.
 Vec3 (Vec3 const &in)
 Initialise from Vec3.
double operator[] (int i) const
 Getter function, index 0 <-> x, 1 <-> y, 2 <-> z.
double & operator[] (int i)
 Setter function, index 0 <-> x, 1 <-> y, 2 <-> z.
double Dot (const Vec3 rhs) const
 Calculate the dot product of two vectors.
Vec3 Cross (const Vec3 rhs) const
 Calculate the cross product of two vectors.
double GetNorm2Squared (void) const
 Calculate the Euclidean norm of the vector, squared (= sum of squared elements).
double GetNorm2 (void) const
 Calculate the Euclidean norm of the vector.
Vec3 GetUnitVector (void) const
 Get the unit vector pointing along the same direction as this vector. Will fail for zero vectors.
Vec3operator= (const Vec3 &other)
Vec3 operator+ (const Vec3 rhs) const
Vec3 operator- (const Vec3 rhs) const
Vec3 operator/ (const double rhs) const
Vec3 operator+ () const
Vec3 operator- () const
Vec3 operator+= (const Vec3 rhs)
Vec3 operator-= (const Vec3 rhs)
Vec3 operator*= (const double &rhs)
Vec3 operator/= (const double &rhs)

Public Attributes

double x
double y
double z
 the three components of the vector

Detailed Description

3D vector class with common vector operations.

Definition at line 35 of file Vec3.h.

Constructor & Destructor Documentation

◆ Vec3() [1/4]

CommonMath::Vec3::Vec3 ( void )
inline

Initialises all members to NaN.

Definition at line 40 of file Vec3.h.

◆ Vec3() [2/4]

CommonMath::Vec3::Vec3 ( double xin,
double yin,
double zin )
inline

Initialise vector.

Definition at line 46 of file Vec3.h.

◆ Vec3() [3/4]

CommonMath::Vec3::Vec3 ( const double in[3])
inline

Initialise vector.

Definition at line 50 of file Vec3.h.

◆ Vec3() [4/4]

CommonMath::Vec3::Vec3 ( Vec3 const & in)
inline

Initialise from Vec3.

Definition at line 54 of file Vec3.h.

Member Function Documentation

◆ Cross()

Vec3 CommonMath::Vec3::Cross ( const Vec3 rhs) const
inline

Calculate the cross product of two vectors.

Definition at line 103 of file Vec3.h.

◆ Dot()

double CommonMath::Vec3::Dot ( const Vec3 rhs) const
inline

Calculate the dot product of two vectors.

Definition at line 97 of file Vec3.h.

◆ GetNorm2()

double CommonMath::Vec3::GetNorm2 ( void ) const
inline

Calculate the Euclidean norm of the vector.

Definition at line 115 of file Vec3.h.

◆ GetNorm2Squared()

double CommonMath::Vec3::GetNorm2Squared ( void ) const
inline

Calculate the Euclidean norm of the vector, squared (= sum of squared elements).

Definition at line 109 of file Vec3.h.

◆ GetUnitVector()

Vec3 CommonMath::Vec3::GetUnitVector ( void ) const
inline

Get the unit vector pointing along the same direction as this vector. Will fail for zero vectors.

Definition at line 121 of file Vec3.h.

◆ operator*=()

Vec3 CommonMath::Vec3::operator*= ( const double & rhs)
inline

Definition at line 169 of file Vec3.h.

◆ operator+() [1/2]

Vec3 CommonMath::Vec3::operator+ ( ) const
inline

Definition at line 150 of file Vec3.h.

◆ operator+() [2/2]

Vec3 CommonMath::Vec3::operator+ ( const Vec3 rhs) const
inline

Definition at line 138 of file Vec3.h.

◆ operator+=()

Vec3 CommonMath::Vec3::operator+= ( const Vec3 rhs)
inline

Definition at line 159 of file Vec3.h.

◆ operator-() [1/2]

Vec3 CommonMath::Vec3::operator- ( ) const
inline

Definition at line 154 of file Vec3.h.

◆ operator-() [2/2]

Vec3 CommonMath::Vec3::operator- ( const Vec3 rhs) const
inline

Definition at line 142 of file Vec3.h.

◆ operator-=()

Vec3 CommonMath::Vec3::operator-= ( const Vec3 rhs)
inline

Definition at line 164 of file Vec3.h.

◆ operator/()

Vec3 CommonMath::Vec3::operator/ ( const double rhs) const
inline

Definition at line 146 of file Vec3.h.

◆ operator/=()

Vec3 CommonMath::Vec3::operator/= ( const double & rhs)
inline

Definition at line 174 of file Vec3.h.

◆ operator=()

Vec3 & CommonMath::Vec3::operator= ( const Vec3 & other)
inline

Definition at line 127 of file Vec3.h.

◆ operator[]() [1/2]

double & CommonMath::Vec3::operator[] ( int i)
inline

Setter function, index 0 <-> x, 1 <-> y, 2 <-> z.

Definition at line 77 of file Vec3.h.

◆ operator[]() [2/2]

double CommonMath::Vec3::operator[] ( int i) const
inline

Getter function, index 0 <-> x, 1 <-> y, 2 <-> z.

Definition at line 59 of file Vec3.h.

Member Data Documentation

◆ x

double CommonMath::Vec3::x

Definition at line 38 of file Vec3.h.

◆ y

double CommonMath::Vec3::y

Definition at line 38 of file Vec3.h.

◆ z

double CommonMath::Vec3::z

the three components of the vector

Definition at line 38 of file Vec3.h.


The documentation for this class was generated from the following file:
  • demos/multicopter/CommonMath/Vec3.h