TBTK
Need a break? Support the development by playing Polarity Puzzles
TBTK::Vector3d Class Reference

Public Member Functions

 Vector3d ()
 
 Vector3d (std::initializer_list< double > components)
 
 Vector3d (const std::vector< double > &components)
 
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 friend Vector3d operator* (double lhs, const Vector3d &rhs)
 
std::ostream & operator<< (std::ostream &stream, const Vector3d &v)
 

Constructor & Destructor Documentation

◆ Vector3d() [1/3]

TBTK::Vector3d::Vector3d ( )

Constructor.

◆ Vector3d() [2/3]

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

Constructor.

◆ Vector3d() [3/3]

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

Constructor.

Member Function Documentation

◆ dotProduct()

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

Dot product.

◆ getStdVector()

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

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

◆ norm()

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

Norm.

◆ operator*() [1/2]

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

Multiplication operator (cross product).

◆ operator*() [2/2]

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

Multiplication operator (vector*scalar).

◆ operator+()

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

Addition operator.

◆ operator-() [1/2]

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

Inversion operator.

◆ operator-() [2/2]

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

Subtraction operator.

◆ operator/()

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

Division operator.

◆ parallel()

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.

◆ perpendicular()

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.

◆ unit()

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

◆ operator*

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

Multiplication operator (scalar*vector).

◆ operator<<

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

operator<< for ostream.

Member Data Documentation

◆ x

double TBTK::Vector3d::x

x-component.

◆ y

double TBTK::Vector3d::y

y-component.

◆ z

double TBTK::Vector3d::z

z-component.


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