Wheatley  20150125
A simple C++ vector library
Wheatley::CVector Class Reference

Public Member Functions

 CVector ()
 
virtual ~CVector ()
 
double getMagnitude () const
 
void setMagnitude (double magnitude)
 
double getTheta () const
 
void setTheta (double theta)
 
double getXComponent () const
 
void setXComponent (double component)
 
double getXTheta () const
 
void setXTheta (double theta)
 
double getYComponent () const
 
void setYComponent (double component)
 
double getYTheta () const
 
void setYTheta (double theta)
 
double toRadian (double angle)
 
double toDegree (double angle)
 
CVector operator+ (const CVector &)
 
CVector operator- (const CVector &)
 
CVector operator= (const CVector &)
 
void CalcComponents ()
 
void CalcMagnitude ()
 
void CalcTheta ()
 
void CreateVector ()
 

Public Attributes

double XComponent
 
double XTheta
 
double YComponent
 
double YTheta
 
double Magnitude
 
double Theta
 

Constructor & Destructor Documentation

Wheatley::CVector::CVector ( )

Default constructor for initializing a two dimensional cartesian vector

Wheatley::CVector::~CVector ( )
virtual

Default destructor for deleting a two dimensional cartesian vector

Member Function Documentation

void Wheatley::CVector::CalcComponents ( )

takes the magnitude and angle a vector makes with the x-axis and splits it into its X and Y components

void Wheatley::CVector::CalcMagnitude ( )

takes the x and y components and calculates the magnitude of the vector

void Wheatley::CVector::CalcTheta ( )

calculates the Theta value based on the x and y components of the vector by getting the arctan value from them

void Wheatley::CVector::CreateVector ( )

creates the vector based on user input

double Wheatley::CVector::getMagnitude ( ) const
inline

returns the magnitude of the vector

Returns
The magnitude of the vector
double Wheatley::CVector::getTheta ( ) const
inline

gets the the angle the vector makes with the x-axis

Returns
the angle the vector makes with the x-axis
double Wheatley::CVector::getXComponent ( ) const
inline

gets the X component of the vector

Returns
the X component of the vector
double Wheatley::CVector::getXTheta ( ) const
inline

gets the angle between the X and Y components of the vector

Returns
the angle between the X and Y components of the vector
double Wheatley::CVector::getYComponent ( ) const
inline

gets the Y component of the vector

Returns
the Y component of the vector
double Wheatley::CVector::getYTheta ( ) const
inline

gets the angle between the Y component and the magnitude

Returns
the angle between the Y component and the magnitude
CVector Wheatley::CVector::operator+ ( const CVector param)

adds the X and Y components of two vectors

CVector Wheatley::CVector::operator- ( const CVector param)

subrtacts the X and Y components of two vectors

CVector Wheatley::CVector::operator= ( const CVector param)

sets one vector equal to another

void Wheatley::CVector::setMagnitude ( double  magnitude)
inline

sets the magnitude of the vector

Parameters
magnitudethe magnitude of the vector
void Wheatley::CVector::setTheta ( double  theta)
inline

sets the angle made with the x-axis

Parameters
thetathe angle the vector makes with the x-axis
void Wheatley::CVector::setXComponent ( double  component)
inline

sets the X component of the vector

Parameters
componentthe X component of the vector
void Wheatley::CVector::setXTheta ( double  theta)
inline

sets the angle between the X and Y components of the vector

Parameters
thetathe angle between the X and Y components of the vector
void Wheatley::CVector::setYComponent ( double  component)
inline

sets the Y component of the vector

Parameters
componentthe Y component of the vector
void Wheatley::CVector::setYTheta ( double  theta)
inline

sets the angle between the Y component and the magnitude

Parameters
thetathe angle between the Y component and the magnitude
double Wheatley::CVector::toDegree ( double  angle)
inline

converts an angle from radians to degrees

Parameters
anglethe angle, in radians, to be converted
Returns
thhe angle in degrees
double Wheatley::CVector::toRadian ( double  angle)
inline

converts an angle from degrees to radians

Parameters
anglethe angle, in degrees, to be converted
Returns
the angle in radians

Member Data Documentation

double Wheatley::CVector::Magnitude

the magnitude of the vector

double Wheatley::CVector::Theta

The angle the vector makes with the with the x-axis

double Wheatley::CVector::XComponent

The X component of the vector

double Wheatley::CVector::XTheta

The angle of between the X and Y components

double Wheatley::CVector::YComponent

The Y component of the vector

double Wheatley::CVector::YTheta

The angle between the Y component and the magnitude


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