Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Public Member Functions | Friends | List of all members
OVector3D Class Reference

The 3D vector class. More...

#include <3d.h>

Inheritance diagram for OVector3D:
Inheritance graph
[legend]
Collaboration diagram for OVector3D:
Collaboration graph
[legend]

Public Member Functions

 OVector3D ()
 Default constructor. More...
 
 OVector3D (const OVector3D &vector)
 Copy constructor. More...
 
 OVector3D (const OCoord3D &coord)
 Constructs a new vector from a 3D coordinate. Works like the copy constructor. More...
 
 OVector3D (const OCoord3D &coordFrom, const OCoord3D &coordTo)
 Constructs a new vector from 2 coordinates. More...
 
 OVector3D (double x, double y, double z)
 Constructs a new vector from 3 doubles. More...
 
virtual ~OVector3D ()
 Destructor. More...
 
void reset ()
 Reset this vector. More...
 
OVector3Doperator= (const OVector3D &vector)
 operators More...
 
bool operator== (const OVector3D &vector) const
 
bool operator!= (const OVector3D &vector) const
 
OVector3D operator+ (const OVector3D &vector) const
 
OVector3D operator- (const OVector3D &vector) const
 
OVector3D operator* (const OVector3D &vector) const
 
OVector3D operator* (const double a) const
 Multiplication with a scalar (commutative). More...
 
double dot (const OVector3D &v)
 dot product (assuming an orthonormal reference frame) More...
 
OVector3D cross (const OVector3D &vector) const
 Cross product. More...
 
void balance (double c1, const OVector3D &vector2, double c2)
 Balances this vector. More...
 
double scalar (const OVector3D &vector) const
 Performs the scalar product between this object and another vector. More...
 
double norme () const
 Computes the length of this vector. More...
 
OVector3D normal (const OVector3D &vector2, const OVector3D &vector3) const
 Computes the normal with this vector and 2 others. More...
 
void normalize ()
 Normalizes this vector. More...
 
void invert ()
 Inverts this vector. More...
 
double angle (const OVector3D &vector) const
 Computes the angle between this vector and another vector. More...
 
OVector3D getRotationOz (double alpha)
 Returns the vector after a rotation around z axis \ x -> xprime. Both of these vectors will be given in the \ original base. More...
 
OVector3D getRotationOzBase2 (double alpha)
 Returns the vector after a rotation around z axis \ and gives back the coordinates of xprime or yprime in the \ new basis Bprime. More...
 
OVector3D getRotationOy (double alpha)
 Returns the vector after a rotation around z axis. More...
 
OVector3D getRotationOyBase2 (double alpha)
 Returns the vector after a rotation around y axis \ and gives back the coordinates of xprime or zprime in the \ new basis Bprime. More...
 
OVector3D getRotationOzOy (double alpha, double theta)
 Returns the vector after 2 rotations around z axis and y axis. It gives the coordinates of xsecond, ysecond and zsecond in the first basis B. More...
 
- Public Member Functions inherited from OCoord3D
 OCoord3D ()
 Default constructor. More...
 
 OCoord3D (const OCoord3D &coord)
 Copy constructor. More...
 
 OCoord3D (double x, double y, double z)
 Constructor with 3D point coordinates. More...
 
virtual ~OCoord3D ()
 Destructor. More...
 
OCoord3Doperator= (const OCoord3D &coord)
 operator= More...
 
bool operator== (const OCoord3D &coord) const
 operator== More...
 
bool operator!= (const OCoord3D &coord) const
 operator!= More...
 
void setCoords (double x, double y, double z)
 Sets the coordinates as an array of double. More...
 
void setCoords (double coords[3])
 Sets the coordinates as an array of double. More...
 
void getCoords (double coords[3])
 Gets the coordinates as an array of double. More...
 
double * getCoords ()
 Gets the coordinates as an array of double. More...
 
 operator const double * () const
 
 operator double * ()
 

Friends

OVector3D operator* (const double a, const OVector3D &vector)
 Multiplication with a scalar (commutative). More...
 

Additional Inherited Members

- Public Attributes inherited from OCoord3D
union {
   struct {
      double   _x
 x coordinate of OCoord3D More...
 
      double   _y
 y coordinate of OCoord3D More...
 
      double   _z
 z coordinate of OCoord3D More...
 
   } 
 
   double   _value [3]
 
}; 
 

Detailed Description

The 3D vector class.

Definition at line 297 of file 3d.h.

Constructor & Destructor Documentation

◆ OVector3D() [1/5]

OVector3D::OVector3D ( )

Default constructor.

Definition at line 113 of file 3d.cpp.

◆ OVector3D() [2/5]

OVector3D::OVector3D ( const OVector3D vector)

Copy constructor.

Definition at line 115 of file 3d.cpp.

◆ OVector3D() [3/5]

OVector3D::OVector3D ( const OCoord3D coord)

Constructs a new vector from a 3D coordinate. Works like the copy constructor.

Parameters
coordA 3D coordinate.

Definition at line 117 of file 3d.cpp.

◆ OVector3D() [4/5]

OVector3D::OVector3D ( const OCoord3D coordFrom,
const OCoord3D coordTo 
)

Constructs a new vector from 2 coordinates.

Parameters
coordFromThe 1st coordinate.
coordToThe 2nd coordinate.

Definition at line 119 of file 3d.cpp.

◆ OVector3D() [5/5]

OVector3D::OVector3D ( double  x,
double  y,
double  z 
)

Constructs a new vector from 3 doubles.

Parameters
xX coordinate.
yY coordinate.
zZ coordinate.

Definition at line 126 of file 3d.cpp.

◆ ~OVector3D()

OVector3D::~OVector3D ( )
virtual

Destructor.

Definition at line 128 of file 3d.cpp.

Member Function Documentation

◆ angle()

double OVector3D::angle ( const OVector3D vector) const

Computes the angle between this vector and another vector.

Parameters
vectorThe vector to mesure the angle with this vector.

Definition at line 243 of file 3d.cpp.

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

◆ balance()

void OVector3D::balance ( double  c1,
const OVector3D vector2,
double  c2 
)

Balances this vector.

Parameters
c1The balance value for this vector.
vector2The other member for the balance.
c2The balance value for the second vector.

Definition at line 205 of file 3d.cpp.

◆ cross()

OVector3D OVector3D::cross ( const OVector3D vector) const

Cross product.

Parameters
vectorThe object reference with which this object is multiplicated.
Returns
The result of the cross product.

Definition at line 196 of file 3d.cpp.

Here is the caller graph for this function:

◆ dot()

double OVector3D::dot ( const OVector3D v)
inline

dot product (assuming an orthonormal reference frame)

Definition at line 362 of file 3d.h.

Here is the caller graph for this function:

◆ getRotationOy()

OVector3D OVector3D::getRotationOy ( double  alpha)

Returns the vector after a rotation around z axis.

Definition at line 267 of file 3d.cpp.

Here is the caller graph for this function:

◆ getRotationOyBase2()

OVector3D OVector3D::getRotationOyBase2 ( double  alpha)

Returns the vector after a rotation around y axis \ and gives back the coordinates of xprime or zprime in the \ new basis Bprime.

Definition at line 293 of file 3d.cpp.

◆ getRotationOz()

OVector3D OVector3D::getRotationOz ( double  alpha)

Returns the vector after a rotation around z axis \ x -> xprime. Both of these vectors will be given in the \ original base.

Definition at line 254 of file 3d.cpp.

Here is the caller graph for this function:

◆ getRotationOzBase2()

OVector3D OVector3D::getRotationOzBase2 ( double  alpha)

Returns the vector after a rotation around z axis \ and gives back the coordinates of xprime or yprime in the \ new basis Bprime.

Definition at line 280 of file 3d.cpp.

Here is the caller graph for this function:

◆ getRotationOzOy()

OVector3D OVector3D::getRotationOzOy ( double  alpha,
double  theta 
)

Returns the vector after 2 rotations around z axis and y axis. It gives the coordinates of xsecond, ysecond and zsecond in the first basis B.

Definition at line 306 of file 3d.cpp.

Here is the caller graph for this function:

◆ invert()

void OVector3D::invert ( )

Inverts this vector.

Definition at line 236 of file 3d.cpp.

◆ normal()

OVector3D OVector3D::normal ( const OVector3D vector2,
const OVector3D vector3 
) const

Computes the normal with this vector and 2 others.

Returns
The normal.

Definition at line 220 of file 3d.cpp.

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

◆ normalize()

void OVector3D::normalize ( )

Normalizes this vector.

Definition at line 225 of file 3d.cpp.

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

◆ norme()

double OVector3D::norme ( ) const

Computes the length of this vector.

Returns
The length of this vector.

Definition at line 215 of file 3d.cpp.

Here is the caller graph for this function:

◆ operator!=()

bool OVector3D::operator!= ( const OVector3D vector) const

Definition at line 148 of file 3d.cpp.

Here is the call graph for this function:

◆ operator*() [1/2]

OVector3D OVector3D::operator* ( const double  a) const

Multiplication with a scalar (commutative).

Parameters
aA scalar value.

Definition at line 181 of file 3d.cpp.

◆ operator*() [2/2]

OVector3D OVector3D::operator* ( const OVector3D vector) const

Definition at line 171 of file 3d.cpp.

◆ operator+()

OVector3D OVector3D::operator+ ( const OVector3D vector) const

Definition at line 153 of file 3d.cpp.

◆ operator-()

OVector3D OVector3D::operator- ( const OVector3D vector) const

Definition at line 162 of file 3d.cpp.

◆ operator=()

OVector3D & OVector3D::operator= ( const OVector3D vector)

operators

Definition at line 137 of file 3d.cpp.

Here is the call graph for this function:

◆ operator==()

bool OVector3D::operator== ( const OVector3D vector) const

Definition at line 143 of file 3d.cpp.

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

◆ reset()

void OVector3D::reset ( )

Reset this vector.

Definition at line 130 of file 3d.cpp.

◆ scalar()

double OVector3D::scalar ( const OVector3D vector) const

Performs the scalar product between this object and another vector.

Parameters
vectorThe other member for the scalar product.
Returns
The result of the scalar product.

Definition at line 210 of file 3d.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator*

OVector3D operator* ( const double  a,
const OVector3D vector 
)
friend

Multiplication with a scalar (commutative).

Parameters
aA scalar value.
vectorVector to multiply.

Definition at line 187 of file 3d.cpp.


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