Public Member Functions | Public Attributes | List of all members
Vector3D Class Reference

3D Mathematical vector More...

#include <Vector3D.hpp>

Public Member Functions

 Vector3D (void)
 Null constructor. More...
 
 Vector3D (double ix, double iy, double iz)
 Class constructor. More...
 
 Vector3D (const Vector3D &v)
 Class copy constructor. More...
 
void Set (double ix, double iy, double iz)
 Set vector components. More...
 
Vector3Doperator+= (Vector3D const &v)
 Addition. More...
 
Vector3Doperator-= (Vector3D const &v)
 Subtraction. More...
 
Vector3Doperator= (Vector3D const &v)
 Assignment operator. More...
 
Vector3Doperator*= (double s)
 Scalar product. More...
 
bool operator== (Vector3D const &v)
 Compare 3D-Vectors (up to an arbitrary precision) More...
 
void RotateX (double a)
 Rotates the vector around the X axes. More...
 
void RotateY (double a)
 Rotates the vector around the Y axes. More...
 
void RotateZ (double a)
 Rotates the vector around the Z axes. More...
 
void Round ()
 Integer round of the vector's entries.
 

Public Attributes

double x
 Component in the x direction.
 
double y
 Component in the y direction.
 
double z
 Component in the z direction.
 

Detailed Description

3D Mathematical vector

Definition at line 15 of file Vector3D.hpp.

Constructor & Destructor Documentation

◆ Vector3D() [1/3]

Vector3D::Vector3D ( void  )

Null constructor.

Sets all components to 0

Definition at line 49 of file Vector3D.cpp.

Here is the caller graph for this function:

◆ Vector3D() [2/3]

Vector3D::Vector3D ( double  ix,
double  iy,
double  iz 
)

Class constructor.

Parameters
ixx Component
iyy Component
izz Component

Definition at line 52 of file Vector3D.cpp.

◆ Vector3D() [3/3]

Vector3D::Vector3D ( const Vector3D v)

Class copy constructor.

Parameters
vOther vector

Definition at line 55 of file Vector3D.cpp.

Member Function Documentation

◆ operator*=()

Vector3D & Vector3D::operator*= ( double  s)

Scalar product.

Parameters
sScalar
Returns
Reference to the vector multiplied by scalar

Definition at line 75 of file Vector3D.cpp.

◆ operator+=()

Vector3D & Vector3D::operator+= ( Vector3D const &  v)

Addition.

Parameters
vVector to be added
Returns
Reference to sum

Definition at line 83 of file Vector3D.cpp.

◆ operator-=()

Vector3D & Vector3D::operator-= ( Vector3D const &  v)

Subtraction.

Parameters
vVector to be subtracted
Returns
Difference

Definition at line 91 of file Vector3D.cpp.

◆ operator=()

Vector3D & Vector3D::operator= ( Vector3D const &  v)

Assignment operator.

Parameters
vVector to be copied
Returns
The assigned value

Definition at line 65 of file Vector3D.cpp.

◆ operator==()

bool Vector3D::operator== ( Vector3D const &  v)

Compare 3D-Vectors (up to an arbitrary precision)

Parameters
vVector to be compared to
Returns
True/False - according to the comparison results.

Definition at line 101 of file Vector3D.cpp.

Here is the call graph for this function:

◆ RotateX()

void Vector3D::RotateX ( double  a)

Rotates the vector around the X axes.

Parameters
aAngle of rotation (in radians)

Definition at line 106 of file Vector3D.cpp.

◆ RotateY()

void Vector3D::RotateY ( double  a)

Rotates the vector around the Y axes.

Parameters
aAngle of rotation (in radians)

Definition at line 116 of file Vector3D.cpp.

◆ RotateZ()

void Vector3D::RotateZ ( double  a)

Rotates the vector around the Z axes.

Parameters
aAngle of rotation (in radians)

Definition at line 126 of file Vector3D.cpp.

◆ Set()

void Vector3D::Set ( double  ix,
double  iy,
double  iz 
)

Set vector components.

Parameters
ixx Component
iyy Component
izz Component

Definition at line 58 of file Vector3D.cpp.


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