|
| Vector2 () |
| Empty.
|
|
| Vector2 (const double &) |
| Create a vector with the same real coordinates. More...
|
|
| Vector2 (const double &, const double &) |
| Create a vector with argument coordinates.
|
|
| Vector2 (const Vector &) |
| Create a two dimension vector from another three dimension vector.
|
|
double & | operator[] (int) |
| Gets the i-th coordinate of vector.
|
|
constexpr double | operator[] (int) const |
| Returns the i-th coordinate of vector.
|
|
Vector2 | Orthogonal () const |
| Returns a direct orthogonal vector.
|
|
Vector2 | operator+ () const |
| Overloaded.
|
|
Vector2 | operator- () const |
| Overloaded.
|
|
Vector2 & | operator+= (const Vector2 &) |
| Destructive addition.
|
|
Vector2 & | operator-= (const Vector2 &) |
| Destructive subtraction.
|
|
Vector2 & | operator*= (const Vector2 &) |
| Destructively scale a vector by another vector.
|
|
Vector2 & | operator/= (const Vector2 &) |
| Destructively divide the components of a vector by another vector.
|
|
Vector2 & | operator*= (double) |
| Destructive scalar multiply.
|
|
Vector2 & | operator/= (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 | ToVector (const double &=0.0) const |
| Convert a Vector2 to a Vector. More...
|
|
Vector2 | Inverse () const |
| Inverse of a vector. More...
|
|
int | Quadrant (const Vector2 &) const |
| Computes quadrant index of a vector with respect to the vector object. More...
|
|
QString | ToString (int=6) const |
| Create a QString form a vector. More...
|
|
Vector2 | Scaled (const Vector2 &) const |
| Scales the vector. More...
|
|
void | Scale (const Vector2 &) |
| Scales the vector. More...
|
|
Vector2 | Sort () const |
| Sort the terms of the vector into ascending order.
|
|
double | Angle (const Vector2 &) const |
| Compute the angle between two vectors. More...
|
|
double | Angle () const |
| Compute the angle of a vector. More...
|
|
Vector2 | Floor () const |
| Compute the numerator part of the coordinates. More...
|
|
Vector2 | Fract () const |
| Compute the fractional part of the coordinates. More...
|
|
|
static bool | Equal (const Vector2 &, const Vector2 &, const double &=0.0001) |
| Test if two vectors are almost equal. More...
|
|
static Vector2 | Min (const Vector2 &, const Vector2 &) |
| Return a vector with coordinates set to the minimum coordinates of the two argument vectors.
|
|
static Vector2 | Max (const Vector2 &, const Vector2 &) |
| Return a vector with coordinates set to the maximum coordinates of the two argument vectors.
|
|
static void | SetMinMax (const Vector2 &, Vector2 &, Vector2 &) |
| Update the minimum and maximum values given a vector. More...
|
|
static Vector2 | Modulo (const Vector2 &, const Vector2 &) |
| Modulo of two vectors. More...
|
|
static Vector2 | Lerp (const Vector2 &, const Vector2 &, const double &) |
| Linear interpolation between two vectors. More...
|
|
static Vector2 | Bilinear (const Vector2 &, const Vector2 &, const Vector2 &, const Vector2 &, const double &, const double &) |
| Bi-linear interpolation between four vectors. More...
|
|
static Vector2 | FromString (QString) |
| Creates a vector from a QString. More...
|
|
static Vector2 | Polar (const double &) |
| Creates a vector given polar coordinates. More...
|
|
static Vector2 | Solve (const Vector2 &, const Vector2 &, const double &, const double &) |
| Compute the point on a segment such that the linear function satisfies f(a)=va and f(b)=vb. More...
|
|
static bool | Clockwise (const Vector2 &, const Vector2 &, const Vector2 &) |
| Returns true if the three points make a clockwise turn. More...
|
|
|
bool | operator> (const Vector2 &, const Vector2 &) |
| Compare two vectors.
|
|
bool | operator< (const Vector2 &, const Vector2 &) |
| Compare two vectors.
|
|
bool | operator>= (const Vector2 &, const Vector2 &) |
| Overloaded.
|
|
bool | operator<= (const Vector2 &, const Vector2 &) |
| Overloaded.
|
|
Vector2 | operator+ (const Vector2 &, const Vector2 &) |
| Adds up two vectors.
|
|
Vector2 | operator- (const Vector2 &, const Vector2 &) |
| Difference between two vectors.
|
|
double | operator* (const Vector2 &, const Vector2 &) |
| Dot product between two vectors. More...
|
|
Vector2 | operator* (const Vector2 &, double) |
| Right multiply by a scalar.
|
|
Vector2 | operator* (double, const Vector2 &) |
| Left multiply by a scalar.
|
|
Vector2 | operator/ (const Vector2 &, double) |
| Left divide by a scalar.
|
|
double | operator/ (const Vector2 &, const Vector2 &) |
| Cross productof two vectors. Note that the derminant of a 2-square matrix is the cross product of its two colum vectors.
|
|
bool | operator== (const Vector2 &, const Vector2 &) |
| Strong equality test.
|
|
bool | operator!= (const Vector2 &, const Vector2 &) |
| Strong difference test.
|
|
double | Norm (const Vector2 &) |
| Compute the Euclidean norm of a vector. This function involves a square root computation, it is often more efficient to rely on the squared norm of a vector instead. More...
|
|
double | SquaredNorm (const Vector2 &) |
| Compute the squared Euclidean norm of a vector. More...
|
|
double | NormInfinity (const Vector2 &) |
| Compute the infinity norm of a vector. More...
|
|
void | Normalize (Vector2 &) |
| Normalize a two dimensional vector. More...
|
|
Vector2 | Normalized (const Vector2 &) |
| Return a Normalized a vector, computing the inverse of its norm and scaling the components. This function does not check if the vector is null, which might result in errors.
|
|
double | Sine (const Vector2 &, const Vector2 &) |
| Returns the sine of two vectors. More...
|
|
double | Cosine (const Vector2 &, const Vector2 &) |
| Returns the positive cosine of two vectors. More...
|
|
Vector2 | Abs (const Vector2 &) |
| Computes the absolute value of a vector.
|
|
void | Swap (Vector2 &, Vector2 &) |
| Swap two vectors. More...
|
|
Vector2 | Clamp (const Vector2 &, const Vector2 &, const Vector2 &) |
| Clamp a Vector2 between two bounds. More...
|
|
double | WhichSide (const Vector2 &, const Vector2 &, const Vector2 &) |
| Compute the position of a point with respect to a line. More...
|
|
bool | IsLeft (const Vector2 &, const Vector2 &, const Vector2 &) |
| Compute the position of a point with respect to a line. More...
|
|
bool | IsRight (const Vector2 &, const Vector2 &, const Vector2 &) |
| Compute the position of a point with respect to a line. More...
|
|
std::ostream & | operator<< (std::ostream &, const Vector2 &) |
| Overloaded output-stream operator. More...
|
|
Vectors in two dimensions.
This class implements most operators and member functions as for Vector class.