Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

C2DVector Class Reference

Class represents a 2D vector from the origin. More...

#include <2DVector.h>

List of all members.

Public Member Functions

 C2DVector (void)
 Constructor.
 ~C2DVector (void)
 Destructor.
 C2DVector (double di, double dj)
 Constructor with assignment.
 C2DVector (const C2DVector &Other)
 Constructor with assignment.
 C2DVector (const C2DPoint &PointFrom, const C2DPoint &PointTo)
 Constructor provides 2 points, this being the vector from the first to the second.
 C2DVector (const C2DPoint &Point)
 Constructor converts a point to the vector (a point can be interpreted as a point and vice versa).
void Set (double di, double dj)
 Sets to the values given.
void Set (const C2DPoint &PointFrom, const C2DPoint &PointTo)
 Sets it to be the vector from the 1st to the second.
void Reverse (void)
 Reverses the direction of the vector.
void TurnRight (void)
 Turns right 90 degrees.
void TurnRight (double dAng)
 Turns right by the angle given in radians.
void TurnLeft (void)
 Turns left by 90 degrees.
void TurnLeft (double dAng)
 Turns left by the angle given in radians.
double GetLength (void) const
 Returns the distance of the vector.
void SetLength (double dDistance)
 Sets the length of the vector.
void MakeUnit (void)
 Makes the vector unit.
const C2DVector operator+ (const C2DVector &Other) const
 Addition.
const C2DVector operator- (const C2DVector &Other) const
 Subtraction.
void operator+= (const C2DVector &Other)
 Addition.
void operator-= (const C2DVector &Other)
 Subtraction.
const C2DVector operator * (const double dFactor) const
 Multiplication.
void operator *= (const double dFactor)
 Multiplication.
const double Dot (const C2DVector &Other) const
 Dot product.
const double Cross (const C2DVector &Other) const
 Cross product.
const C2DVectoroperator= (const C2DVector &Other)
 Assignment.
const C2DVectoroperator= (const C2DPoint &Other)
 Assignment to a point.
bool operator== (const C2DVector &Other) const
 Equality test.
bool operator!= (const C2DVector &Other) const
 Inequality test.
double AngleFromNorth (void) const
 Returns the angle from north in radians.
double AngleToRight (const C2DVector &Other) const
 Returns the angle to the right to another vector.
double AngleToLeft (const C2DVector &Other) const
 Returns the angle to the left to another vector.
double AngleBetween (const C2DVector &Other) const
 Returns the shortest angle between 2 vectors i.e. the dot product of the norms.

Public Attributes

double i
 The value in the x axis.
double j
 The value in the y axis.


Detailed Description

Class represents a 2D vector from the origin.

Class represents a 2D vector from the origin. includes a variety of functions for simple manipulation.

---------------------------------------------------------------------------


Constructor & Destructor Documentation

C2DVector::C2DVector void   ) 
 

Constructor.

--------------------------------------------------------------------------
C2DVector::C2DVector

---------------------------------------------------------------------------

C2DVector::~C2DVector void   ) 
 

Destructor.

--------------------------------------------------------------------------
C2DVector::~C2DVector

---------------------------------------------------------------------------

C2DVector::C2DVector double  di,
double  dj
 

Constructor with assignment.

--------------------------------------------------------------------------
C2DVector::C2DVector

---------------------------------------------------------------------------

C2DVector::C2DVector const C2DVector Other  ) 
 

Constructor with assignment.

--------------------------------------------------------------------------
C2DVector::C2DVector

---------------------------------------------------------------------------

C2DVector::C2DVector const C2DPoint PointFrom,
const C2DPoint PointTo
 

Constructor provides 2 points, this being the vector from the first to the second.

--------------------------------------------------------------------------
C2DVector::C2DVector

---------------------------------------------------------------------------

C2DVector::C2DVector const C2DPoint Point  ) 
 

Constructor converts a point to the vector (a point can be interpreted as a point and vice versa).

--------------------------------------------------------------------------
C2DVector::C2DVector

---------------------------------------------------------------------------


Member Function Documentation

double C2DVector::AngleBetween const C2DVector Other  )  const
 

Returns the shortest angle between 2 vectors i.e. the dot product of the norms.

--------------------------------------------------------------------------
C2DVector::AngleBetween

---------------------------------------------------------------------------

double C2DVector::AngleFromNorth void   )  const
 

Returns the angle from north in radians.

--------------------------------------------------------------------------
C2DVector::AngleFromNorth

---------------------------------------------------------------------------

double C2DVector::AngleToLeft const C2DVector Other  )  const
 

Returns the angle to the left to another vector.

--------------------------------------------------------------------------
C2DVector::AngleToLeft

---------------------------------------------------------------------------

double C2DVector::AngleToRight const C2DVector Other  )  const
 

Returns the angle to the right to another vector.

--------------------------------------------------------------------------
C2DVector::AngleToRight

---------------------------------------------------------------------------

const double C2DVector::Cross const C2DVector Other  )  const
 

Cross product.

--------------------------------------------------------------------------
C2DVector::Cross

---------------------------------------------------------------------------

const double C2DVector::Dot const C2DVector Other  )  const
 

Dot product.

--------------------------------------------------------------------------
C2DVector::Dot

---------------------------------------------------------------------------

double C2DVector::GetLength void   )  const
 

Returns the distance of the vector.

--------------------------------------------------------------------------
C2DVector::GetDistance

---------------------------------------------------------------------------

void C2DVector::MakeUnit void   ) 
 

Makes the vector unit.

--------------------------------------------------------------------------
C2DVector::MakeUnit

---------------------------------------------------------------------------

const C2DVector C2DVector::operator * const double  dFactor  )  const
 

Multiplication.

--------------------------------------------------------------------------
C2DVector::operator*

---------------------------------------------------------------------------

void C2DVector::operator *= const double  dFactor  ) 
 

Multiplication.

--------------------------------------------------------------------------
C2DVector::operator*=

---------------------------------------------------------------------------

bool C2DVector::operator!= const C2DVector Other  )  const
 

Inequality test.

--------------------------------------------------------------------------
C2DVector::operator!=

---------------------------------------------------------------------------

const C2DVector C2DVector::operator+ const C2DVector Other  )  const
 

Addition.

--------------------------------------------------------------------------
C2DVector::operator+

---------------------------------------------------------------------------

void C2DVector::operator+= const C2DVector Other  ) 
 

Addition.

--------------------------------------------------------------------------
C2DVector::operator+=

---------------------------------------------------------------------------

const C2DVector C2DVector::operator- const C2DVector Other  )  const
 

Subtraction.

--------------------------------------------------------------------------
C2DVector::operator-

---------------------------------------------------------------------------

void C2DVector::operator-= const C2DVector Other  ) 
 

Subtraction.

--------------------------------------------------------------------------
C2DVector::operator-=

---------------------------------------------------------------------------

const C2DVector & C2DVector::operator= const C2DPoint Other  ) 
 

Assignment to a point.

--------------------------------------------------------------------------
C2DVector::operator =

---------------------------------------------------------------------------

const C2DVector & C2DVector::operator= const C2DVector Other  ) 
 

Assignment.

--------------------------------------------------------------------------
C2DVector::operator=

---------------------------------------------------------------------------

bool C2DVector::operator== const C2DVector Other  )  const
 

Equality test.

--------------------------------------------------------------------------
C2DVector::operator==

---------------------------------------------------------------------------

void C2DVector::Reverse void   ) 
 

Reverses the direction of the vector.

--------------------------------------------------------------------------
C2DVector::Reverse

---------------------------------------------------------------------------

void C2DVector::Set const C2DPoint PointFrom,
const C2DPoint PointTo
 

Sets it to be the vector from the 1st to the second.

--------------------------------------------------------------------------
C2DVector::Set

---------------------------------------------------------------------------

void C2DVector::Set double  di,
double  dj
 

Sets to the values given.

--------------------------------------------------------------------------
C2DVector::Set

---------------------------------------------------------------------------

void C2DVector::SetLength double  dDistance  ) 
 

Sets the length of the vector.

--------------------------------------------------------------------------
C2DVector::SetDistance

---------------------------------------------------------------------------

void C2DVector::TurnLeft double  dAng  ) 
 

Turns left by the angle given in radians.

--------------------------------------------------------------------------
C2DVector::TurnLeft

---------------------------------------------------------------------------

void C2DVector::TurnLeft void   ) 
 

Turns left by 90 degrees.

--------------------------------------------------------------------------
C2DVector::TurnLeft

---------------------------------------------------------------------------

void C2DVector::TurnRight double  dAng  ) 
 

Turns right by the angle given in radians.

--------------------------------------------------------------------------
C2DVector::TurnRight

---------------------------------------------------------------------------

void C2DVector::TurnRight void   ) 
 

Turns right 90 degrees.

--------------------------------------------------------------------------
C2DVector::TurnRight

---------------------------------------------------------------------------


The documentation for this class was generated from the following files:
Generated on Mon Apr 21 11:43:52 2008 for GeoLib by  doxygen 1.4.4