The Gnome Chemistry Utils  0.14.0
Public Member Functions | List of all members
gcu::Vector Class Reference

3D vector. More...

#include <gcu/vector.h>

Inheritance diagram for gcu::Vector:
gcu::Transform3d

Public Member Functions

 Vector ()
 Vector (double x, double y, double z)
 Vector (double d[3])
 Vector (Vector const &v)
Vector operator+ (Vector const &v) const
Vector operator- (Vector const &v) const
Vector operator* (double m) const
Vector operator/ (double d) const
Vector operator*= (double m)
Vector operator/= (double d)
double operator[] (unsigned i) const
double GetLength () const
Vector CreateOrthogonal () const
Vector Cross (Vector const &v) const
void SetX (double val)
double GetX (void) const
double & GetRefX (void)
void SetY (double val)
double GetY (void) const
double & GetRefY (void)
void SetZ (double val)
double GetZ (void) const
double & GetRefZ (void)

Detailed Description

3D vector.

3D vectors class.

Definition at line 39 of file vector.h.

Constructor & Destructor Documentation

gcu::Vector::Vector ( )

Constructs a vector with all three coordinates equal to 0.

gcu::Vector::Vector ( double  x,
double  y,
double  z 
)
Parameters
xthe first coordinate.
ythe second coordinate.
zthe third coordinate.

Constructs a vector using the given coordinates.

gcu::Vector::Vector ( double  d[3])
Parameters
dan array of coordinates.

Constructs a vector using the given coordinates.

gcu::Vector::Vector ( Vector const &  v)
Parameters
va Vector.

Coopy constructor.

Member Function Documentation

Vector gcu::Vector::CreateOrthogonal ( ) const
Returns
a Vector orthogonal to this.
Vector gcu::Vector::Cross ( Vector const &  v) const
Parameters
va Vector.
Returns
the vectorial product of this and v.
double gcu::Vector::GetLength ( ) const
Returns
the Vector module.
gcu::Vector::GetRefX ( void  )
inline
Returns
the first vector coordinate as a reference.

Definition at line 138 of file vector.h.

gcu::Vector::GetRefY ( void  )
inline
Returns
the second vector coordinate as a reference.

Definition at line 150 of file vector.h.

gcu::Vector::GetRefZ ( void  )
inline
Returns
the third vector coordinate as a reference.

Definition at line 162 of file vector.h.

gcu::Vector::GetX ( void  ) const
inline
Returns
the first vector coordinate.

Definition at line 138 of file vector.h.

gcu::Vector::GetY ( void  ) const
inline
Returns
the second vector coordinate.

Definition at line 150 of file vector.h.

gcu::Vector::GetZ ( void  ) const
inline
Returns
the third vector coordinate.

Definition at line 162 of file vector.h.

Vector gcu::Vector::operator* ( double  m) const
Parameters
ma number.
Returns
a Vector equal to m * this.
Vector gcu::Vector::operator*= ( double  m)
Parameters
ma number.

Multiplies this by m.

Returns
this after the multiplication.
Vector gcu::Vector::operator+ ( Vector const &  v) const
Parameters
va Vector.
Returns
the sum of v and this.
Vector gcu::Vector::operator- ( Vector const &  v) const
Parameters
va Vector.
Returns
the difference this minus v.
Vector gcu::Vector::operator/ ( double  d) const
Parameters
da number.
Returns
a Vector equal to (1/d) * this.
Vector gcu::Vector::operator/= ( double  d)
Parameters
da number.

Divides this by d.

Returns
this after the division.
double gcu::Vector::operator[] ( unsigned  i) const
Parameters
ian index.

return the ith coordinate.

gcu::Vector::SetX ( double  x)
inline
Parameters
xthe first coordinate.

Sets the first vector coordinate.

Definition at line 138 of file vector.h.

gcu::Vector::SetY ( double  y)
inline
Parameters
ythe second coordinate.

Sets the second vector coordinate.

Definition at line 150 of file vector.h.

gcu::Vector::SetZ ( double  z)
inline
Parameters
zthe third coordinate.

Sets the third vector coordinate.

Definition at line 162 of file vector.h.


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