ionflux.org | Impressum

Ionflux::Tools::Vector3 Class Reference
[Vector mathematics]

Vector (R3). More...

#include <Vector3.hpp>

Inheritance diagram for Ionflux::Tools::Vector3:

Inheritance graph
[legend]
Collaboration diagram for Ionflux::Tools::Vector3:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Vector3 ()
 Constructor.
 Vector3 (double initX1, double initX2, double initX3)
 Constructor.
 Vector3 (const Vector3 &initVec)
 Constructor.
 Vector3 (const double *initComp)
 Constructor.
virtual ~Vector3 ()
 Destructor.
virtual void setComps (double newX1, double newX2, double newX3)
 Set components.
virtual void setComps (const double *newComp)
 Set components.
virtual void setComp (int compIndex, double newComp)
 Set component.
virtual std::string toString () const
 Create string representation.
virtual Vector3operator= (const Vector3 &newVec)
 Assignment operator.
virtual Vector3 operator+ (const Vector3 &otherVec) const
 Add operator.
virtual Vector3 operator- (const Vector3 &otherVec) const
 Subtract operator.
virtual Vector3operator+= (const Vector3 &otherVec)
 Add operator.
virtual Vector3operator-= (const Vector3 &otherVec)
 Subtract operator.
virtual double operator * (const Vector3 &otherVec) const
 Multiply operator.
virtual Vector3operator *= (double a)
 Multiply operator.
virtual Vector3 operator * (double a) const
 Multiply operator.
virtual double operator[] (int compIndex) const
 Subscript operator.
virtual void setX1 (double newX1)
 Set x1 component.
virtual void setX2 (double newX2)
 Set x2 component.
virtual void setX3 (double newX3)
 Set x3 component.
virtual double getX1 () const
 Get x1 component.
virtual double getX2 () const
 Get x2 component.
virtual double getX3 () const
 Get x3 component.

Protected Attributes

double * comp
 Components.

Detailed Description

Vector (R3).

A vector in three dimensional space.


Constructor & Destructor Documentation

Ionflux::Tools::Vector3::Vector3  ) 
 

Constructor.

Construct new Vector3 object.

Ionflux::Tools::Vector3::Vector3 double  initX1,
double  initX2,
double  initX3
 

Constructor.

Construct new Vector3 object.

Parameters:
initX1 x1 component.
initX2 x2 component.
initX3 x3 component.

Ionflux::Tools::Vector3::Vector3 const Vector3 initVec  ) 
 

Constructor.

Construct new Vector3 object.

Parameters:
initVec Vector (R3).

Ionflux::Tools::Vector3::Vector3 const double *  initComp  ) 
 

Constructor.

Construct new Vector3 object.

Note:
initComp is expected to have a size of at least 3.
Parameters:
initComp Array of vector components.

Ionflux::Tools::Vector3::~Vector3  )  [virtual]
 

Destructor.

Destruct Vector3 object.


Member Function Documentation

double Ionflux::Tools::Vector3::getX1  )  const [virtual]
 

Get x1 component.

Returns:
Current value of x1 component.

double Ionflux::Tools::Vector3::getX2  )  const [virtual]
 

Get x2 component.

Returns:
Current value of x2 component.

double Ionflux::Tools::Vector3::getX3  )  const [virtual]
 

Get x3 component.

Returns:
Current value of x3 component.

Vector3 Ionflux::Tools::Vector3::operator * double  a  )  const [virtual]
 

Multiply operator.

Calculate the product of the vector and a scalar.

Parameters:
a Scalar.

double Ionflux::Tools::Vector3::operator * const Vector3 otherVec  )  const [virtual]
 

Multiply operator.

Calculate the scalar product of two vectors.

Parameters:
otherVec Vector (R3).

Vector3 & Ionflux::Tools::Vector3::operator *= double  a  )  [virtual]
 

Multiply operator.

Calculate the product of the vector and a scalar.

Parameters:
a Scalar.

Vector3 Ionflux::Tools::Vector3::operator+ const Vector3 otherVec  )  const [virtual]
 

Add operator.

Add one vector to another vector.

Parameters:
otherVec Vector (R3).

Vector3 & Ionflux::Tools::Vector3::operator+= const Vector3 otherVec  )  [virtual]
 

Add operator.

Add one vector to another vector.

Parameters:
otherVec Vector (R3).

Vector3 Ionflux::Tools::Vector3::operator- const Vector3 otherVec  )  const [virtual]
 

Subtract operator.

Subtract one vector from another vector.

Parameters:
otherVec Vector (R3).

Vector3 & Ionflux::Tools::Vector3::operator-= const Vector3 otherVec  )  [virtual]
 

Subtract operator.

Subtract one vector from another vector.

Parameters:
otherVec Vector (R3).

Vector3 & Ionflux::Tools::Vector3::operator= const Vector3 newVec  )  [virtual]
 

Assignment operator.

Assign one vector to another vector.

Parameters:
newVec Vector (R3).

double Ionflux::Tools::Vector3::operator[] int  compIndex  )  const [virtual]
 

Subscript operator.

Access a component of the vector.

Note:
If compIndex is out of range, the function returns 0.
Parameters:
compIndex Component index (0...2).

void Ionflux::Tools::Vector3::setComp int  compIndex,
double  newComp
[virtual]
 

Set component.

Set the specified component of the vector.

Note:
If compIndex is out of range, this function does nothing.
Parameters:
compIndex Component index (0...2)
newComp New value of component.

void Ionflux::Tools::Vector3::setComps const double *  newComp  )  [virtual]
 

Set components.

Set the components of the vector.

Note:
newComp is expected to have a size of at least 3.
Parameters:
newComp Component array.

void Ionflux::Tools::Vector3::setComps double  newX1,
double  newX2,
double  newX3
[virtual]
 

Set components.

Set the components of the vector.

Parameters:
newX1 x1 component.
newX2 x2 component.
newX3 x3 component.

void Ionflux::Tools::Vector3::setX1 double  newX1  )  [virtual]
 

Set x1 component.

Set new value of x1 component.

Parameters:
newX1 New value of x1 component.

void Ionflux::Tools::Vector3::setX2 double  newX2  )  [virtual]
 

Set x2 component.

Set new value of x2 component.

Parameters:
newX2 New value of x2 component.

void Ionflux::Tools::Vector3::setX3 double  newX3  )  [virtual]
 

Set x3 component.

Set new value of x3 component.

Parameters:
newX3 New value of x3 component.

std::string Ionflux::Tools::Vector3::toString  )  const [virtual]
 

Create string representation.

Create a string representation of the vector (i.e. "(&lt;x1&gt;,&lt;x2&gt;,&lt;x3&gt;))").


Member Data Documentation

double* Ionflux::Tools::Vector3::comp [protected]
 

Components.


The documentation for this class was generated from the following files:
Generated on Tue Mar 14 21:12:06 2006 for Ionflux Tools Class Library (iftools) by  doxygen 1.4.6