FormIt C++ API
v23.0.0 (2023.0.0)
|
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 |
Vector2d & | normalize (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 |
Vector2d & | set (double xx, double yy) |
Vector2d & | zero () |
Vector2d & | scale (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 |
|
inline |
|
inline |
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 |
det function.
[in] | v1 | |
[in] | v2 |
|
inline |
|
inline |
|
inline |
Vector2d WSM::Vector2d::getNormalized | ( | double | epsSqrd = WSM_MACHINE_TOL2 | ) | const |
|
inline |
|
inline |
|
inline |
|
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 |
|
inline |
|
inline |
|
inline |
Vector2d& WSM::Vector2d::normalize | ( | double | epsSqrd = WSM_MACHINE_TOL2 | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
|
static |
|
static |
double WSM::Vector2d::x |
double WSM::Vector2d::y |