TBTK
TBTK::Vector2d Class Reference

Public Member Functions

 Vector2d ()
 
 Vector2d (std::initializer_list< double > components)
 
 Vector2d (const std::vector< double > &components)
 
 ~Vector2d ()
 
const Vector2d operator+ (const Vector2d &rhs) const
 
const Vector2d operator- (const Vector2d &rhs) const
 
const Vector2d operator- () const
 
const Vector2d operator* (double rhs) const
 
const Vector2d operator/ (double rhs) const
 
const Vector2d unit () const
 
const Vector2d perpendicular (const Vector2d &v) const
 
const Vector2d parallel (const Vector2d &v) const
 
double norm () const
 
const std::vector< double > getStdVector () const
 

Static Public Member Functions

static double dotProduct (const Vector2d &lhs, const Vector2d &rhs)
 

Public Attributes

double x
 
double y
 

Friends

const Vector2d operator* (double lhs, const Vector2d &rhs)
 
std::ostream & operator<< (std::ostream &stream, const Vector2d &v)
 

Constructor & Destructor Documentation

TBTK::Vector2d::Vector2d ( )

Constructor.

TBTK::Vector2d::Vector2d ( std::initializer_list< double >  components)

Constructor.

TBTK::Vector2d::Vector2d ( const std::vector< double > &  components)

Constructor.

TBTK::Vector2d::~Vector2d ( )

Destructor.

Member Function Documentation

double TBTK::Vector2d::dotProduct ( const Vector2d lhs,
const Vector2d rhs 
)
inlinestatic

Dot product.

const std::vector< double > TBTK::Vector2d::getStdVector ( ) const
inline

Get a std::vector<double> representation of the vector.

double TBTK::Vector2d::norm ( ) const
inline

Norm.

const Vector2d TBTK::Vector2d::operator* ( double  rhs) const
inline

Multiplication operator (vector*scalar).

const Vector2d TBTK::Vector2d::operator+ ( const Vector2d rhs) const
inline

Addition operator.

const Vector2d TBTK::Vector2d::operator- ( const Vector2d rhs) const
inline

Subtraction operator.

const Vector2d TBTK::Vector2d::operator- ( ) const
inline

Inversion operator.

const Vector2d TBTK::Vector2d::operator/ ( double  rhs) const
inline

Division operator.

const Vector2d TBTK::Vector2d::parallel ( const Vector2d v) const
inline

Returns a vector that is the component of the vector that is parallel to the argument.

const Vector2d TBTK::Vector2d::perpendicular ( const Vector2d v) const
inline

Returns a vector tha is the component of the vector that is perpendicular to the argument.

const Vector2d TBTK::Vector2d::unit ( ) const
inline

Returns a unit vector pointing in the same direction as the original vector.

Friends And Related Function Documentation

const Vector2d operator* ( double  lhs,
const Vector2d rhs 
)
friend

Multiplication operator (scalar*vector).

std::ostream& operator<< ( std::ostream &  stream,
const Vector2d v 
)
friend

operator<< for ostream.

Member Data Documentation

double TBTK::Vector2d::x

x-component.

double TBTK::Vector2d::y

y-component.


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