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

Description

The Vector2d class stores a vector in 2D space.

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

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

#include <Vector2d.h>

Public Member Functions

 Vector2d ()
 
 Vector2d (double xx, double yy)
 
Vector2d operator+ (const Vector2d &v) const
 
Vector2d operator- (const Vector2d &v) const
 
double operator% (const Vector2d &v) const
 
Vector2d operator- () const
 
Vector2d operator* (double scalar) const
 
Vector2d operator/ (double scalar) const
 
double operator[] (size_t index) const
 
double & operator[] (size_t index)
 
double length () const
 
double lengthSqrd () const
 
double lengthRect () const
 
Vector2dnormalize (double epsSqrd=WSM_MACHINE_TOL2)
 
Vector2d getNormalized (double epsSqrd=WSM_MACHINE_TOL2) const
 
double dist (const Vector2d &v) const
 
double distSqrd (const Vector2d &v) const
 
double distRect (const Vector2d &v) const
 
bool isEqual (const Vector2d &v, double epsSqrd=WSM_DISTANCE_TOL2) const
 
bool isEqualRect (const Vector2d &v, double epsRect=WSM_DISTANCE_TOL) const
 
bool isExactNull () const
 
bool isParallel (const Vector2d &, double epsNorSqrd=WSM_ANGLE_TOL2) const
 
bool isPerpend (const Vector2d &, double epsNor=WSM_ANGLE_TOL) const
 
void operator+= (const Vector2d &v)
 
void operator-= (const Vector2d &v)
 
void operator*= (double scalar)
 
void operator/= (double scalar)
 
Vector2d perpend () const
 
double angle (const Vector2d &, double epsNor=WSM_ANGLE_TOL) const
 
double angleBetweenNormalized (const Vector2d &aV, double epsNor=WSM_ANGLE_TOL) const
 
bool isNull (double epsSqrd=WSM_DISTANCE_TOL2) const
 
Vector2dset (double xx, double yy)
 
Vector2dzero ()
 
Vector2dscale (const Vector2d &v)
 
Vector2d getScaled (const Vector2d &v) const
 

Static Public Member Functions

static double det (const Vector2d &v1, const Vector2d &v2)
 det function. More...
 

Public Attributes

double x
 
double y
 

Static Public Attributes

static const Vector2d kNull
 
static const Vector2d kXDir
 
static const Vector2d kYDir
 

Constructor & Destructor Documentation

WSM::Vector2d::Vector2d ( )
inline
WSM::Vector2d::Vector2d ( double  xx,
double  yy 
)
inline

Member Function Documentation

double WSM::Vector2d::angle ( const Vector2d ,
double  epsNor = WSM_ANGLE_TOL 
) const
double WSM::Vector2d::angleBetweenNormalized ( const Vector2d aV,
double  epsNor = WSM_ANGLE_TOL 
) const
static double WSM::Vector2d::det ( const Vector2d v1,
const Vector2d v2 
)
inlinestatic

det function.

Parameters
[in]v1
[in]v2
double WSM::Vector2d::dist ( const Vector2d v) const
inline
double WSM::Vector2d::distRect ( const Vector2d v) const
inline
double WSM::Vector2d::distSqrd ( const Vector2d v) const
inline
Vector2d WSM::Vector2d::getNormalized ( double  epsSqrd = WSM_MACHINE_TOL2) const
Vector2d WSM::Vector2d::getScaled ( const Vector2d v) const
inline
bool WSM::Vector2d::isEqual ( const Vector2d v,
double  epsSqrd = WSM_DISTANCE_TOL2 
) const
inline
bool WSM::Vector2d::isEqualRect ( const Vector2d v,
double  epsRect = WSM_DISTANCE_TOL 
) const
inline
bool WSM::Vector2d::isExactNull ( ) const
inline
bool WSM::Vector2d::isNull ( double  epsSqrd = WSM_DISTANCE_TOL2) const
inline
bool WSM::Vector2d::isParallel ( const Vector2d ,
double  epsNorSqrd = WSM_ANGLE_TOL2 
) const
bool WSM::Vector2d::isPerpend ( const Vector2d ,
double  epsNor = WSM_ANGLE_TOL 
) const
double WSM::Vector2d::length ( ) const
inline
double WSM::Vector2d::lengthRect ( ) const
inline
double WSM::Vector2d::lengthSqrd ( ) const
inline
Vector2d& WSM::Vector2d::normalize ( double  epsSqrd = WSM_MACHINE_TOL2)
double WSM::Vector2d::operator% ( const Vector2d v) const
inline
Vector2d WSM::Vector2d::operator* ( double  scalar) const
inline
void WSM::Vector2d::operator*= ( double  scalar)
inline
Vector2d WSM::Vector2d::operator+ ( const Vector2d v) const
inline
void WSM::Vector2d::operator+= ( const Vector2d v)
inline
Vector2d WSM::Vector2d::operator- ( const Vector2d v) const
inline
Vector2d WSM::Vector2d::operator- ( ) const
inline
void WSM::Vector2d::operator-= ( const Vector2d v)
inline
Vector2d WSM::Vector2d::operator/ ( double  scalar) const
inline
void WSM::Vector2d::operator/= ( double  scalar)
inline
double WSM::Vector2d::operator[] ( size_t  index) const
inline
double& WSM::Vector2d::operator[] ( size_t  index)
inline
Vector2d WSM::Vector2d::perpend ( ) const
inline
Vector2d& WSM::Vector2d::scale ( const Vector2d v)
inline
Vector2d& WSM::Vector2d::set ( double  xx,
double  yy 
)
inline
Vector2d& WSM::Vector2d::zero ( )
inline

Member Data Documentation

const Vector2d WSM::Vector2d::kNull
static
const Vector2d WSM::Vector2d::kXDir
static
const Vector2d WSM::Vector2d::kYDir
static
double WSM::Vector2d::x
double WSM::Vector2d::y

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