|
| Vector () |
| Empty.
|
|
| Vector (const double &) |
| Create a vector with the same coordinates. More...
|
|
| Vector (const double &, const double &, const double &) |
| Create a vector with argument coordinates. More...
|
|
constexpr double & | operator[] (int) |
| Gets the i-th coordinate of vector.
|
|
constexpr double | operator[] (int) const |
| Returns the i-th coordinate of vector.
|
|
Vector | operator+ () const |
| Overloaded.
|
|
Vector | operator- () const |
| Overloaded.
|
|
Vector & | operator+= (const Vector &) |
| Destructive addition.
|
|
Vector & | operator-= (const Vector &) |
| Destructive subtraction.
|
|
Vector & | operator*= (const Vector &) |
| Destructively scale a vector by another vector. More...
|
|
Vector & | operator/= (const Vector &) |
| Destructively divide the components of a vector by another vector.
|
|
Vector & | operator*= (const double &) |
| Destructive scalar multiply.
|
|
Vector & | operator/= (const double &) |
| Destructive division by a scalar.
|
|
double | Max () const |
| Compute the maximum component of a vector. More...
|
|
int | MaxIndex () const |
| Compute the index of the maximum component of a vector. More...
|
|
int | MinIndex () const |
| Compute the index of the minimum component of a vector. More...
|
|
Vector | Orthogonal () const |
| Returns a vector orthogonal to the argument vector. More...
|
|
void | RandomOrthonormal (Vector &, Vector &) const |
| Computes two random orthonormal vectors to the argument vector. More...
|
|
void | Orthonormal (Vector &, Vector &) const |
| Given a vector, creates two vectors xand y that form an orthogonal basis. More...
|
|
int | Octant (const Vector &) const |
| Computes octant index of a vector with respect to the vector object. More...
|
|
Vector | Scaled (const Vector &) const |
| Scale a vector. More...
|
|
Vector | Inverse () const |
| Inverse of a vector. More...
|
|
Vector | Sort () const |
| Sort the terms of the vector into ascending order.
|
|
QString | ToString (int=6) const |
| Create a QString form a vector. More...
|
|
double | Angle (const Vector &) const |
| Compute the angle between two vectors. More...
|
|
Vector | Fract () const |
| Compute the fractional part of the coordinates. More...
|
|
Vector | Floor () const |
| Compute the numerator part of the coordinates. More...
|
|
|
static bool | Equal (const Vector &, const Vector &, const double &=0.0001) |
| Test if two vectors are almost equal. More...
|
|
static Vector | Min (const Vector &, const Vector &) |
| Return a vector with coordinates set to the minimum coordinates of the two argument vectors.
|
|
static Vector | Max (const Vector &, const Vector &) |
| Return a vector with coordinates set to the maximum coordinates of the two argument vectors.
|
|
static void | SetMinMax (const Vector &, Vector &, Vector &) |
| Update the minimum and maximum values given a vector. More...
|
|
static Vector | Mod (const Vector &, const Vector &) |
| Modulo of two Vectors. More...
|
|
static bool | Coplanar (const Vector &, const Vector &, const Vector &, const double &=1.0e-6) |
| Check if three vectors are coplanar. More...
|
|
static bool | Coplanar (const Vector &, const Vector &, const Vector &, const Vector &, const double &=1.0e-6) |
| Check if four points are coplanar. More...
|
|
static Vector | Bilinear (const Vector &, const Vector &, const Vector &, const Vector &, const double &, const double &) |
| Bi-linear interpolation between four vectors. More...
|
|
static Vector | Trilinear (const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const double &, const double &, const double &) |
| Trilinear interpolation between eight vectors. More...
|
|
static double | Slope (const Vector &, const Vector &) |
| Compute the vertical slope between two vectors. More...
|
|
static Vector | FromString (QString) |
| Creates a vector from a QString. More...
|
|
static Vector | Polar (const double &, const double &) |
| Creates a vector given polar coordinates. More...
|
|
static Vector | Solve (const Vector &, const Vector &, const double &, const double &) |
| Compute the point on a segment such that the linear function satisfies f(a)=va and f(b)=vb. More...
|
|
|
bool | operator> (const Vector &, const Vector &) |
| Compare two vectors.
|
|
bool | operator< (const Vector &, const Vector &) |
| Compare two vectors.
|
|
bool | operator>= (const Vector &, const Vector &) |
| Overloaded.
|
|
bool | operator<= (const Vector &, const Vector &) |
| Overloaded.
|
|
Vector | operator+ (const Vector &, const Vector &) |
| Adds up two vectors.
|
|
Vector | operator- (const Vector &, const Vector &) |
| Difference between two vectors.
|
|
constexpr friend double | operator* (const Vector &, const Vector &) |
| Scalar product.
|
|
Vector | operator* (const Vector &, double) |
| Right multiply by a scalar.
|
|
Vector | operator* (const double &, const Vector &) |
| Left multiply by a scalar.
|
|
Vector | operator/ (const Vector &, double) |
| Left multiply by a scalar.
|
|
Vector | operator/ (const Vector &, const Vector &) |
| Cross product.
|
|
bool | operator== (const Vector &, const Vector &) |
| Strong equality test.
|
|
bool | operator!= (const Vector &, const Vector &) |
| Strong difference test.
|
|
double | Norm (const Vector &) |
| Compute the Euclidean norm of a vector. More...
|
|
double | SquaredNorm (const Vector &) |
| Compute the squared Euclidean norm of a vector. More...
|
|
double | NormInfinity (const Vector &) |
| Compute the norm infinity of a vector. More...
|
|
void | Normalize (Vector &) |
| Normalize a vector, computing the inverse of its norm and scaling the components. More...
|
|
Vector | Normalized (const Vector &) |
| Return a normalized vector. More...
|
|
double | Sine (const Vector &, const Vector &) |
| Returns the positive sine of two vectors. More...
|
|
double | Cosine (const Vector &, const Vector &) |
| Returns the positive cosine of two vectors. More...
|
|
Vector | Abs (const Vector &) |
| Computes the absolute value of a vector. More...
|
|
void | Swap (Vector &, Vector &) |
| Swap two vectors. More...
|
|
void | Swap (Vector *&, Vector *&) |
| Swap two pointers to (arrays) vectors. More...
|
|
int | Aligned (const Vector &, const Vector &) |
| Check if two vectors are aligned. More...
|
|
Vector | Clamp (const Vector &, const Vector &, const Vector &) |
| Clamp a vector between two bounds. More...
|
|
Vector | Lerp (const Vector &, const Vector &, const double &) |
| Linear interpolation between two vectors. More...
|
|
std::ostream & | operator<< (std::ostream &, const Vector &) |
| Overloaded output-stream operator. More...
|
|
Vectors in three dimensions.
Most binary operators have been overloaded as expected, destructive operators, such as addition and subtraction have been implemented and behave as one could expect.
How do I compute the cross product of two vectors?
Simply use the overloaded Vector::operator/, for instance
Vectors in three dimensions.
Definition: evector.h:21
double c[3]
Components.
Definition: evector.h:23
computes the cross product of a and b.
How do I compute the sine of the angle between two vectors?
Simply use the Sine(const Vector&,const Vector&) function, which internally computes the norm of the cross product divided by the norm of the argument vectors.
friend double Sine(const Vector &, const Vector &)
Returns the positive sine of two vectors.
Definition: evector.cpp:111
How can I get access to the x, y and z components of a vector?
Use v[0], v[1] and v[2] to get access to the x, y and z components of a vector v respectively.
How do I compute the normal of a triangle?
Let a,b,c the vertices of the triangle, simply compute the cross product
or use the member function of the Triangle class:
Base minimum storage triangle class.
Definition: triangle.h:17
Vector Normal() const
Compute the normal vector of the triangle.
Definition: triangle.cpp:64
How can I sort the three elements in a vector?
Use Vector::Sort() as follows:
Vector()
Empty.
Definition: evector.h:26
How do I perform bi-linear interpolation on vectors?
Use Vector::Bilinear() with four vectors and bilinear coordinates. Alternatively, some geometric classes implement bilinear interpolation, such as Quadrangle::Vertex().