My Project
Public Member Functions | Static Public Member Functions | List of all members
GVector Class Reference

Define geometric vector. More...

#include "geometry/gvector.h"

Inheritance diagram for GVector:
Inheritance graph
[legend]

Public Member Functions

 GVector ()
 
 GVector (double X, double Y, double Z, double hc)
 
 GVector (const GVector &other)
 
 GVector (GVector &&other)
 
 ~GVector ()
 
GVectoroperator= (GVector other)
 
GVector operator+ (const GVector other)
 
GVector operator- (const GVector other)
 
GVector operator/ (const double value)
 
GVector operator* (const double value)
 
double & operator[] (const size_t index)
 
const double & operator[] (const size_t index) const
 
vector< double > getVec () const
 
double length ()
 
GVector normalize ()
 
GVector operator* (GMatrix matrix)
 
bool operator== (const GVector &other) const
 
bool operator!= (const GVector &other) const
 

Static Public Member Functions

static GVector cross (GVector first, GVector second)
 
static double scalar (GVector first, GVector second)
 
static double angle (GVector first, GVector second)
 

Detailed Description

Define geometric vector.

Geometric vector specified with 3 coordinates and length value

Definition at line 26 of file gvector.h.

Constructor & Destructor Documentation

§ GVector() [1/4]

GVector::GVector ( )

Emty constructor. Creates vector and sets it with zero values

Definition at line 6 of file gvector.cpp.

§ GVector() [2/4]

GVector::GVector ( double  X,
double  Y,
double  Z,
double  hc 
)

Constructor. Creates vector and sets it with incoming values

Parameters
[in]XX coordinate
[in]YY coordinate
[in]ZZ coordinate
[in]hcHomogeneous coordinates

Definition at line 14 of file gvector.cpp.

§ GVector() [3/4]

GVector::GVector ( const GVector other)

Constructor. Copies incoming vector.

Parameters
[in]otherSource vector to copy.

Definition at line 22 of file gvector.cpp.

Here is the call graph for this function:

§ GVector() [4/4]

GVector::GVector ( GVector &&  other)

Constructor. Transfer incoming vector.

Parameters
[in]otherSource vector to transfer.

Definition at line 27 of file gvector.cpp.

§ ~GVector()

GVector::~GVector ( )

Destructor. Clears current vector.

Definition at line 32 of file gvector.cpp.

Member Function Documentation

§ angle()

double GVector::angle ( GVector  first,
GVector  second 
)
static

Angle between two vectors

Parameters
[in]firstFirst vector
[in]secondSecond vector
Returns
Angle between vectors in degrees

Definition at line 148 of file gvector.cpp.

Here is the call graph for this function:

§ cross()

GVector GVector::cross ( GVector  first,
GVector  second 
)
static

Vector product

Parameters
[in]firstFirst vector to multiply
[in]secondSecond vector to multiply
Returns
Vector after cross product

Definition at line 132 of file gvector.cpp.

Here is the caller graph for this function:

§ getVec()

vector< double > GVector::getVec ( ) const

Returns current vector

Returns
Current vector

Definition at line 101 of file gvector.cpp.

Here is the caller graph for this function:

§ length()

double GVector::length ( )

Geometric length of vector

Returns
Length of vector

Definition at line 106 of file gvector.cpp.

Here is the caller graph for this function:

§ normalize()

GVector GVector::normalize ( )

Normalize current vector

Returns
Normalized vector

Definition at line 115 of file gvector.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ operator!=()

bool GVector::operator!= ( const GVector other) const

Compare two vectors

Parameters
[in]otherVector to compare
Returns
TRUE if vectors are not similar. FALSE in other case.

Definition at line 186 of file gvector.cpp.

§ operator*() [1/2]

GVector GVector::operator* ( const double  value)

Multiply this vector with incoming value

Parameters
[in]valueValue to multiply
Returns
GVector vector after multiply

Definition at line 73 of file gvector.cpp.

§ operator*() [2/2]

GVector GVector::operator* ( GMatrix  matrix)

Multiply this vector by matrix

Parameters
[in]matrixMatrix to multiply
Returns
Vector multiplied by matrix

Definition at line 161 of file gvector.cpp.

§ operator+()

GVector GVector::operator+ ( const GVector  other)

Sum this vector with incoming vector values

Parameters
[in]otherSource vector to sum
Returns
GVector vector after sum

Definition at line 43 of file gvector.cpp.

§ operator-()

GVector GVector::operator- ( const GVector  other)

Difference between this vector and incoming vector

Parameters
[in]otherSource vector to diff
Returns
GVector vector after diff

Definition at line 53 of file gvector.cpp.

§ operator/()

GVector GVector::operator/ ( const double  value)

Divide this vector with incoming value

Parameters
[in]valueValue to divide
Returns
GVector vector after divide

Definition at line 63 of file gvector.cpp.

§ operator=()

GVector & GVector::operator= ( GVector  other)

Sets vector with sourse`s vector values

Parameters
[in]otherSource vector to copy
Returns
GVector current vector

Definition at line 37 of file gvector.cpp.

Here is the call graph for this function:

§ operator==()

bool GVector::operator== ( const GVector other) const

Compare two vectors

Parameters
[in]otherVector to compare
Returns
TRUE if vectors are similar. FALSE in other case.

Definition at line 174 of file gvector.cpp.

§ operator[]() [1/2]

double & GVector::operator[] ( const size_t  index)

Chooses coordinate by index: 0-X; 1-Y; 2-Z; 3-homogeneous coordinates

Parameters
[in]indexIndex of choosen coordinate
Returns
value of choosen coordinate

Definition at line 83 of file gvector.cpp.

§ operator[]() [2/2]

const double & GVector::operator[] ( const size_t  index) const

Const method. Chooses coordinate by index: 0-X; 1-Y; 2-Z; 3-homogeneous coordinates

Parameters
[in]indexIndex of choosen coordinate
Returns
value of choosen coordinate

Definition at line 92 of file gvector.cpp.

§ scalar()

double GVector::scalar ( GVector  first,
GVector  second 
)
static

Scalar product

Parameters
[in]firstFirst vector to multiply
[in]secondSecond vector to multiply
Returns
Double value after production

Definition at line 143 of file gvector.cpp.

Here is the caller graph for this function:

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