TBTK
TBTK::Vector3d Class Reference

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

double x
 
double y
 
double z
 

Friends

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

Constructor & Destructor Documentation

TBTK::Vector3d::Vector3d ( )

Constructor.

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

Constructor.

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

Constructor.

TBTK::Vector3d::~Vector3d ( )

Destructor.

Member Function Documentation

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

Dot product.

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

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

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

Norm.

const Vector3d TBTK::Vector3d::operator* ( const Vector3d rhs) const
inline

Multiplication operator (cross product).

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

Multiplication operator (vector*scalar).

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

Addition operator.

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

Subtraction operator.

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

Inversion operator.

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

Division operator.

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

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

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

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

const Vector3d TBTK::Vector3d::unit ( ) const
inline

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

Friends And Related Function Documentation

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

Multiplication operator (scalar*vector).

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

operator<< for ostream.

Member Data Documentation

double TBTK::Vector3d::x

x-component.

double TBTK::Vector3d::y

y-component.

double TBTK::Vector3d::z

z-component.


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