Main Page | Namespace List | Alphabetical List | Class List | File List | Namespace Members | Class Members

MyMath::Vector Class Reference

#include <MyVector.h>

List of all members.


Detailed Description

The Vector class.

This is the class of Vectors. The Vectors 3 dimensional and the components are double.

Definition at line 53 of file MyVector.h.

Public Member Functions

 Vector ()
 The default constructor.

 Vector (double _x, double _y, double _z)
 An overloaded constructor.

void operator= (Vector const &otherVec)
 The overloaded assignment operator.

double operator[] (unsigned int index)
 The overloaded indexing operator [].

Vectoroperator+ (Vector const &otherVec)
 The overloaded addition operator.

Vectoroperator- (Vector const &otherVec)
 The overloaded subtraction operator.

Vectoroperator * (double scalar)
 This is the overloaded * operator.

double operator * (Vector const &otherVec)
 This is yet again the * operator overloaded.

double norm ()
 The function which return the norm of the vector.

void print ()
 The function which dumps the vector to the std::cout stream.


Constructor & Destructor Documentation

MyMath::Vector::Vector  ) 
 

The default constructor.

Using this constructor to create a Vector object results in a Vector whose components are initialized to zero.

MyMath::Vector::Vector double  _x,
double  _y,
double  _z
 

An overloaded constructor.

An overloaded constructor taking as arguments

Parameters:
_x the x-coordinate.
_y the y-coordinate.
_z the z-coordinate.
See also:
Vector();


Member Function Documentation

double MyMath::Vector::norm  ) 
 

The function which return the norm of the vector.

double MyMath::Vector::operator * Vector const &  otherVec  ) 
 

This is yet again the * operator overloaded.

This time the * operator is overloaded to do the dot product of two vectors.

Vector& MyMath::Vector::operator * double  scalar  ) 
 

This is the overloaded * operator.

This operator multiplies a scalar with a vector.

Vector& MyMath::Vector::operator+ Vector const &  otherVec  ) 
 

The overloaded addition operator.

This is to obviously add two vectors.

Vector& MyMath::Vector::operator- Vector const &  otherVec  ) 
 

The overloaded subtraction operator.

This is to obviously subtract two vectors.

void MyMath::Vector::operator= Vector const &  otherVec  ) 
 

The overloaded assignment operator.

This is the overloaded assignment operator and essentially copies the x ,y and z values from the otherVec.

double MyMath::Vector::operator[] unsigned int  index  ) 
 

The overloaded indexing operator [].

This operator is for accessing the individual components of a Vector. This method throws an exception which is an object of class MyMathException.

void MyMath::Vector::print  ) 
 

The function which dumps the vector to the std::cout stream.


The documentation for this class was generated from the following file:
Generated on Fri Aug 6 01:53:21 2004 for MyMath by doxygen 1.3.6