gcu::Vector Class Reference

3D vector. More...

#include <gcu/vector.h>

Inheritance diagram for gcu::Vector:

gcu::Transform3d

List of all members.

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:
x the first coordinate.
y the second coordinate.
z the third coordinate.
Constructs a vector using the given coordinates.

gcu::Vector::Vector ( double  d[3]  ) 

Parameters:
d an array of coordinates.
Constructs a vector using the given coordinates.

gcu::Vector::Vector ( Vector const &  v  ) 

Parameters:
v a 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:
v a 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:
m a number.
Returns:
a Vector equal to m * this.

Vector gcu::Vector::operator*= ( double  m  ) 

Parameters:
m a number.
Multiplies this by m.
Returns:
this after the multiplication.

Vector gcu::Vector::operator+ ( Vector const &  v  )  const

Parameters:
v a Vector.
Returns:
the sum of v and this.

Vector gcu::Vector::operator- ( Vector const &  v  )  const

Parameters:
v a Vector.
Returns:
the difference this minus v.

Vector gcu::Vector::operator/ ( double  d  )  const

Parameters:
d a number.
Returns:
a Vector equal to (1/d) * this.

Vector gcu::Vector::operator/= ( double  d  ) 

Parameters:
d a number.
Divides this by d.
Returns:
this after the division.

double gcu::Vector::operator[] ( unsigned  i  )  const

Parameters:
i an index.
return the ith coordinate.

gcu::Vector::SetX ( double  x  )  [inline]

Parameters:
x the first coordinate.
Sets the first vector coordinate.

Definition at line 138 of file vector.h.

gcu::Vector::SetY ( double  y  )  [inline]

Parameters:
y the second coordinate.
Sets the second vector coordinate.

Definition at line 150 of file vector.h.

gcu::Vector::SetZ ( double  z  )  [inline]

Parameters:
z the 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:

Generated on Fri Sep 24 15:58:47 2010 for The Gnome Chemistry Utils by  doxygen 1.5.9