WSM API v25.0.0 (2025.0.0)
Loading...
Searching...
No Matches
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.
 
Vector3d operator* (const UnitVector3d &v) const
 Cross product.
 
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.
 
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.
 
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

◆ Vector3d() [1/3]

WSM::Vector3d::Vector3d ( )
inline

◆ Vector3d() [2/3]

WSM::Vector3d::Vector3d ( double  xx,
double  yy,
double  zz 
)
inline

◆ Vector3d() [3/3]

WSM::Vector3d::Vector3d ( const UnitVector3d v)
explicit

Member Function Documentation

◆ angle()

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

◆ angleBetweenNormalized()

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

For normalized vectors.

◆ det()

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

◆ dist()

double WSM::Vector3d::dist ( const Vector3d v) const
inline

◆ distRect()

double WSM::Vector3d::distRect ( const Vector3d v) const
inline

◆ distSqrd()

double WSM::Vector3d::distSqrd ( const Vector3d v) const
inline

◆ dominantDirection()

int WSM::Vector3d::dominantDirection ( ) const

◆ getNormalized()

Vector3d WSM::Vector3d::getNormalized ( ) const

◆ getScaled()

Vector3d WSM::Vector3d::getScaled ( const Vector3d v) const
inline

◆ isEqual()

bool WSM::Vector3d::isEqual ( const Vector3d v,
double  epsSqrd = WSM_DISTANCE_TOL2 
) const
inline

◆ isEqualRect()

bool WSM::Vector3d::isEqualRect ( const Vector3d v,
double  epsRect = WSM_DISTANCE_TOL 
) const
inline

◆ isExactNull()

bool WSM::Vector3d::isExactNull ( ) const
inline

◆ isNull()

bool WSM::Vector3d::isNull ( double  epsSqrd = WSM_MACHINE_TOL2) const
inline

◆ isParallel()

bool WSM::Vector3d::isParallel ( const Vector3d ,
double  epsNorSqrd = WSM_ANGLE_TOL2 
) const

◆ isParallelNorm()

bool WSM::Vector3d::isParallelNorm ( const Vector3d ,
double  epsNorSqrd = WSM_ANGLE_TOL2 
) const

For normalized vectors.

◆ isPerpend() [1/2]

bool WSM::Vector3d::isPerpend ( const UnitVector3d ,
double  epsNor = WSM_ANGLE_TOL 
) const

◆ isPerpend() [2/2]

bool WSM::Vector3d::isPerpend ( const Vector3d ,
double  epsNor = WSM_ANGLE_TOL 
) const

◆ length()

double WSM::Vector3d::length ( ) const
inline

◆ lengthRect()

double WSM::Vector3d::lengthRect ( ) const
inline

◆ lengthSqrd()

double WSM::Vector3d::lengthSqrd ( ) const
inline

◆ negate()

Vector3d & WSM::Vector3d::negate ( )
inline

◆ normalize()

Vector3d & WSM::Vector3d::normalize ( )

◆ operator%() [1/2]

double WSM::Vector3d::operator% ( const UnitVector3d v) const

◆ operator%() [2/2]

double WSM::Vector3d::operator% ( const Vector3d v) const
inline

◆ operator*() [1/3]

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

Cross product.

◆ operator*() [2/3]

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

Cross product.

◆ operator*() [3/3]

Vector3d WSM::Vector3d::operator* ( double  scalar) const
inline

◆ operator*=() [1/2]

void WSM::Vector3d::operator*= ( const Transf3d )

◆ operator*=() [2/2]

void WSM::Vector3d::operator*= ( double  scalar)
inline

◆ operator+()

Vector3d WSM::Vector3d::operator+ ( const Vector3d v) const
inline

◆ operator+=()

void WSM::Vector3d::operator+= ( const Vector3d v)
inline

◆ operator-() [1/2]

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

◆ operator-() [2/2]

Vector3d WSM::Vector3d::operator- ( const Vector3d v) const
inline

◆ operator-=()

void WSM::Vector3d::operator-= ( const Vector3d v)
inline

◆ operator/()

Vector3d WSM::Vector3d::operator/ ( double  scalar) const
inline

◆ operator/=()

void WSM::Vector3d::operator/= ( double  scalar)
inline

◆ operator[]() [1/2]

double & WSM::Vector3d::operator[] ( size_t  index)
inline

◆ operator[]() [2/2]

double WSM::Vector3d::operator[] ( size_t  index) const
inline

◆ perpend()

Vector3d WSM::Vector3d::perpend ( ) const

◆ scale()

Vector3d & WSM::Vector3d::scale ( const Vector3d v)
inline

◆ set()

Vector3d & WSM::Vector3d::set ( double  xx,
double  yy,
double  zz 
)
inline

◆ zero()

Vector3d & WSM::Vector3d::zero ( )
inline

Member Data Documentation

◆ kNull

const Vector3d WSM::Vector3d::kNull
static

◆ kXDir

const Vector3d WSM::Vector3d::kXDir
static

◆ kYDir

const Vector3d WSM::Vector3d::kYDir
static

◆ kZDir

const Vector3d WSM::Vector3d::kZDir
static

◆ x

double WSM::Vector3d::x

◆ y

double WSM::Vector3d::y

◆ z

double WSM::Vector3d::z

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