FormIt C++ API  v23.0.0 (2023.0.0)
WSM::Vector3d Class Reference

Description

The Vector3d class stores a vector in 3D space.

The coordinates of the vector are accessed via public data members, x, y, and z, or via the subscript operator, where indices 0, 1, and 2 denote the x-, y-, and z- coordinates, respectively.

The operator '*' is the cross product of vectors, the operator '' is the dot product.

#include <Vector3d.h>

Public Member Functions

 Vector3d ()
 
 Vector3d (double xx, double yy, double zz)
 
 Vector3d (const UnitVector3d &v)
 
Vector3d operator+ (const Vector3d &v) const
 
Vector3d operator- (const Vector3d &v) const
 
double operator% (const Vector3d &v) const
 
double operator% (const UnitVector3d &v) const
 
Vector3d operator* (const Vector3d &v) const
 Cross product. More...
 
Vector3d operator* (const UnitVector3d &v) const
 Cross product. More...
 
Vector3d operator- () const
 
Vector3d operator* (double scalar) const
 
Vector3d operator/ (double scalar) const
 
double operator[] (size_t index) const
 
double & operator[] (size_t index)
 
double length () const
 
double lengthSqrd () const
 
double lengthRect () const
 
Vector3dnormalize ()
 
Vector3d getNormalized () const
 
double dist (const Vector3d &v) const
 
double distSqrd (const Vector3d &v) const
 
double distRect (const Vector3d &v) const
 
bool isEqual (const Vector3d &v, double epsSqrd=WSM_DISTANCE_TOL2) const
 
bool isEqualRect (const Vector3d &v, double epsRect=WSM_DISTANCE_TOL) const
 
double angle (const Vector3d &) const
 
double angleBetweenNormalized (const Vector3d &) const
 For normalized vectors. More...
 
void operator+= (const Vector3d &v)
 
void operator-= (const Vector3d &v)
 
void operator*= (double scalar)
 
void operator/= (double scalar)
 
Vector3d perpend () const
 
void operator*= (const Transf3d &)
 
bool isNull (double epsSqrd=WSM_MACHINE_TOL2) const
 
bool isParallel (const Vector3d &, double epsNorSqrd=WSM_ANGLE_TOL2) const
 
bool isParallelNorm (const Vector3d &, double epsNorSqrd=WSM_ANGLE_TOL2) const
 For normalized vectors. More...
 
bool isPerpend (const Vector3d &, double epsNor=WSM_ANGLE_TOL) const
 
bool isPerpend (const UnitVector3d &, double epsNor=WSM_ANGLE_TOL) const
 
bool isExactNull () const
 
int dominantDirection () const
 
Vector3dset (double xx, double yy, double zz)
 
Vector3dzero ()
 
Vector3dnegate ()
 
Vector3dscale (const Vector3d &v)
 
Vector3d getScaled (const Vector3d &v) const
 

Static Public Member Functions

static double det (const WSM::Vector3d &a, const WSM::Vector3d &b, const WSM::Vector3d &c)
 

Public Attributes

double x
 
double y
 
double z
 

Static Public Attributes

static const Vector3d kNull
 
static const Vector3d kXDir
 
static const Vector3d kYDir
 
static const Vector3d kZDir
 

Constructor & Destructor Documentation

WSM::Vector3d::Vector3d ( )
inline
WSM::Vector3d::Vector3d ( double  xx,
double  yy,
double  zz 
)
inline
WSM::Vector3d::Vector3d ( const UnitVector3d v)
explicit

Member Function Documentation

double WSM::Vector3d::angle ( const Vector3d ) const
double WSM::Vector3d::angleBetweenNormalized ( const Vector3d ) const

For normalized vectors.

static double WSM::Vector3d::det ( const WSM::Vector3d a,
const WSM::Vector3d b,
const WSM::Vector3d c 
)
inlinestatic
double WSM::Vector3d::dist ( const Vector3d v) const
inline
double WSM::Vector3d::distRect ( const Vector3d v) const
inline
double WSM::Vector3d::distSqrd ( const Vector3d v) const
inline
int WSM::Vector3d::dominantDirection ( ) const
Vector3d WSM::Vector3d::getNormalized ( ) const
Vector3d WSM::Vector3d::getScaled ( const Vector3d v) const
inline
bool WSM::Vector3d::isEqual ( const Vector3d v,
double  epsSqrd = WSM_DISTANCE_TOL2 
) const
inline
bool WSM::Vector3d::isEqualRect ( const Vector3d v,
double  epsRect = WSM_DISTANCE_TOL 
) const
inline
bool WSM::Vector3d::isExactNull ( ) const
inline
bool WSM::Vector3d::isNull ( double  epsSqrd = WSM_MACHINE_TOL2) const
inline
bool WSM::Vector3d::isParallel ( const Vector3d ,
double  epsNorSqrd = WSM_ANGLE_TOL2 
) const
bool WSM::Vector3d::isParallelNorm ( const Vector3d ,
double  epsNorSqrd = WSM_ANGLE_TOL2 
) const

For normalized vectors.

bool WSM::Vector3d::isPerpend ( const Vector3d ,
double  epsNor = WSM_ANGLE_TOL 
) const
bool WSM::Vector3d::isPerpend ( const UnitVector3d ,
double  epsNor = WSM_ANGLE_TOL 
) const
double WSM::Vector3d::length ( ) const
inline
double WSM::Vector3d::lengthRect ( ) const
inline
double WSM::Vector3d::lengthSqrd ( ) const
inline
Vector3d& WSM::Vector3d::negate ( )
inline
Vector3d& WSM::Vector3d::normalize ( )
double WSM::Vector3d::operator% ( const Vector3d v) const
inline
double WSM::Vector3d::operator% ( const UnitVector3d v) const
WSM::Vector3d WSM::Vector3d::operator* ( const Vector3d v) const
inline

Cross product.

Vector3d WSM::Vector3d::operator* ( const UnitVector3d v) const

Cross product.

Vector3d WSM::Vector3d::operator* ( double  scalar) const
inline
void WSM::Vector3d::operator*= ( double  scalar)
inline
void WSM::Vector3d::operator*= ( const Transf3d )
Vector3d WSM::Vector3d::operator+ ( const Vector3d v) const
inline
void WSM::Vector3d::operator+= ( const Vector3d v)
inline
Vector3d WSM::Vector3d::operator- ( const Vector3d v) const
inline
Vector3d WSM::Vector3d::operator- ( ) const
inline
void WSM::Vector3d::operator-= ( const Vector3d v)
inline
Vector3d WSM::Vector3d::operator/ ( double  scalar) const
inline
void WSM::Vector3d::operator/= ( double  scalar)
inline
double WSM::Vector3d::operator[] ( size_t  index) const
inline
double& WSM::Vector3d::operator[] ( size_t  index)
inline
Vector3d WSM::Vector3d::perpend ( ) const
Vector3d& WSM::Vector3d::scale ( const Vector3d v)
inline
Vector3d& WSM::Vector3d::set ( double  xx,
double  yy,
double  zz 
)
inline
Vector3d& WSM::Vector3d::zero ( )
inline

Member Data Documentation

const Vector3d WSM::Vector3d::kNull
static
const Vector3d WSM::Vector3d::kXDir
static
const Vector3d WSM::Vector3d::kYDir
static
const Vector3d WSM::Vector3d::kZDir
static
double WSM::Vector3d::x
double WSM::Vector3d::y
double WSM::Vector3d::z

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